20 #ifndef GNASH_NETSTREAM_H
21 #define GNASH_NETSTREAM_H
24 #ifndef __STDC_CONSTANT_MACROS
25 #define __STDC_CONSTANT_MACROS
28 #include <boost/intrusive_ptr.hpp>
30 #include <boost/ptr_container/ptr_deque.hpp>
31 #include <boost/scoped_ptr.hpp>
44 class NetConnection_as;
146 unsigned int fetch(boost::int16_t* samples,
unsigned int nSamples,
150 static unsigned int fetchWrapper(
void* owner, boost::int16_t* samples,
151 unsigned int nSamples,
bool& eof);
230 void seek(boost::uint32_t pos);
236 boost::int32_t
time();
296 std::auto_ptr<image::GnashImage>
get_video();
301 _invalidatedVideoCharacter = ch;
313 static unsigned int audio_streamer(
void *udata, boost::int16_t* samples,
314 unsigned int nSamples,
bool& eof);
356 typedef std::pair<std::string, std::string> NetStreamStatus;
363 void getStatusCodeInfo(StatusCode
code, NetStreamStatus& info);
366 as_object* getStatusObject(StatusCode
code);
372 void initVideoDecoder(
const media::VideoInfo& info);
378 void initAudioDecoder(
const media::AudioInfo& parser);
381 bool startPlayback();
390 void pausePlayback();
400 void unpausePlayback();
416 void refreshVideoFrame(
bool alsoIfPaused =
false);
420 void refreshAudioBuffer();
426 std::auto_ptr<image::GnashImage> decodeNextVideoFrame();
432 BufferedAudioStreamer::CursoredBuffer* decodeNextAudioFrame();
437 void pushDecodedAudioFrames(boost::uint32_t
ts);
449 std::auto_ptr<image::GnashImage> getDecodedVideoFrame(boost::uint32_t
ts);
451 DecodingState decodingStatus(DecodingState newstate = DEC_NONE);
456 void parseNextChunk();
476 void setStatus(StatusCode
code);
488 void processStatusNotifications();
491 void stopAdvanceTimer();
494 void startAdvanceTimer();
496 NetConnection_as* _netCon;
498 boost::scoped_ptr<CharacterProxy> _audioController;
501 boost::uint32_t _bufferTime;
504 boost::mutex image_mutex;
507 std::auto_ptr<image::GnashImage> _imageframe;
513 std::auto_ptr<media::MediaParser> _parser;
519 DisplayObject* _invalidatedVideoCharacter;
521 DecodingState _decoding_state;
525 boost::mutex _state_mutex;
528 std::auto_ptr<media::VideoDecoder> _videoDecoder;
531 bool _videoInfoKnown;
534 std::auto_ptr<media::AudioDecoder> _audioDecoder;
537 bool _audioInfoKnown;
540 boost::scoped_ptr<InterruptableVirtualClock> _playbackClock;
546 sound::sound_handler* _soundHandler;
549 media::MediaHandler* _mediaHandler;
556 std::auto_ptr<IOChannel> _inputStream;
559 BufferedAudioStreamer _audioStreamer;
562 StatusCode _statusCode;
565 boost::mutex _statusMutex;