20 #ifndef GNASH_NETSTREAM_H 21 #define GNASH_NETSTREAM_H 24 #ifndef __STDC_CONSTANT_MACROS 25 #define __STDC_CONSTANT_MACROS 33 #include <boost/intrusive_ptr.hpp> 34 #include <boost/ptr_container/ptr_deque.hpp> 42 class InterruptableVirtualClock;
46 class NetConnection_as;
123 void cleanAudioQueue();
146 void attachAuxStreamer();
153 void detachAuxStreamer();
156 unsigned int fetch(std::int16_t* samples,
unsigned int nSamples,
160 static unsigned int fetchWrapper(
void* owner, std::int16_t* samples,
161 unsigned int nSamples,
bool& eof);
187 pauseModeToggle = -1,
197 return _playHead.getState();
205 int videoHeight()
const;
212 int videoWidth()
const;
240 void seek(std::uint32_t pos);
275 void setBufferTime(std::uint32_t time);
306 std::unique_ptr<image::GnashImage> get_video();
311 _invalidatedVideoCharacter = ch;
314 virtual void markReachableResources()
const;
323 static unsigned int audio_streamer(
void *udata, std::int16_t* samples,
324 unsigned int nSamples,
bool& eof);
366 typedef std::pair<std::string, std::string> NetStreamStatus;
373 void getStatusCodeInfo(StatusCode
code, NetStreamStatus& info);
376 as_object* getStatusObject(StatusCode code);
391 bool startPlayback();
400 void pausePlayback();
410 void unpausePlayback();
426 void refreshVideoFrame(
bool alsoIfPaused =
false);
430 void refreshAudioBuffer();
436 std::unique_ptr<image::GnashImage> decodeNextVideoFrame();
447 void pushDecodedAudioFrames(std::uint32_t
ts);
459 std::unique_ptr<image::GnashImage> getDecodedVideoFrame(std::uint32_t ts);
461 DecodingState decodingStatus(DecodingState newstate = DEC_NONE);
466 void parseNextChunk();
486 void setStatus(StatusCode code);
498 void processStatusNotifications();
501 void stopAdvanceTimer();
504 void startAdvanceTimer();
508 std::unique_ptr<CharacterProxy> _audioController;
511 std::uint32_t _bufferTime;
514 std::mutex image_mutex;
517 std::unique_ptr<image::GnashImage> _imageframe;
523 std::unique_ptr<media::MediaParser> _parser;
532 std::atomic<int> _decoding_state;
535 std::unique_ptr<media::VideoDecoder> _videoDecoder;
538 bool _videoInfoKnown;
541 std::unique_ptr<media::AudioDecoder> _audioDecoder;
544 bool _audioInfoKnown;
547 std::unique_ptr<InterruptableVirtualClock> _playbackClock;
563 std::unique_ptr<IOChannel> _inputStream;
571 std::atomic<int> _statusCode;
sound::sound_handler * _soundHandler
Definition: NetStream_as.h:125
AudioQueue _audioQueue
Definition: NetStream_as.h:129
void registerNetStreamNative(as_object &global)
Definition: NetStream_as.cpp:139
Definition: klash_part.cpp:329
NetStream_as ActionScript class.
Definition: NetStream_as.h:181
DisplayObject is the base class for all DisplayList objects.
Definition: DisplayObject.h:168
std::mutex _audioQueueMutex
Definition: NetStream_as.h:136
std::uint32_t bufferTime()
Definition: NetStream_as.h:282
std::uint32_t ts
Definition: LocalConnection_as.cpp:150
bool isConnected() const
Return true if the NetStream has an associated NetConnection.
Definition: NetStream_as.h:267
uri
Definition: test.py:12
Sound mixer.
Definition: sound_handler.h:87
~CursoredBuffer()
Definition: NetStream_as.h:102
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
boost::ptr_deque< CursoredBuffer > AudioQueue
Definition: NetStream_as.h:120
The base class for all ActionScript objects.
Definition: as_object.h:161
NetConnection ActionScript class.
Definition: NetConnection_as.h:45
void setNetCon(NetConnection_as *nc)
Sets the NetConnection needed to access external files.
Definition: NetStream_as.h:262
A URI for describing as_objects.
Definition: ObjectURI.h:44
Definition: klash_part.cpp:330
code
Definition: GnashKey.h:43
double getCurrentFPS()
Returns the current framerate in frames per second.
Definition: NetStream_as.h:255
The playback controller.
Definition: PlayHead.h:34
std::uint8_t * m_data
Actual data.
Definition: NetStream_as.h:114
CursoredBuffer()
Definition: NetStream_as.h:95
std::uint32_t m_size
Number of samples left in buffer starting from cursor.
Definition: NetStream_as.h:108
std::uint8_t * m_ptr
Cursor into the data.
Definition: NetStream_as.h:117
PauseMode
Definition: NetStream_as.h:186
Buffered AudioStreamer.
Definition: NetStream_as.h:79
PlayHead::PlaybackStatus playbackState() const
Definition: NetStream_as.h:196
PlaybackStatus
Flags for playback state.
Definition: PlayHead.h:39
A buffer with a cursor state.
Definition: NetStream_as.h:92
std::string url
Definition: gnash.cpp:59
void setInvalidatedVideo(DisplayObject *ch)
Register the DisplayObject to invalidate on video updates.
Definition: NetStream_as.h:309
size_t _audioQueueSize
Number of bytes in the audio queue, protected by _audioQueueMutex.
Definition: NetStream_as.h:132
sound::InputStream * _auxStreamer
Definition: NetStream_as.h:139
A native type that requires periodic updates from the core (movie_root).
Definition: Relay.h:79
void netstream_class_init(as_object &where, const ObjectURI &uri)
Definition: NetStream_as.cpp:130