1 #ifndef avfilethread_HEADER_GUARD
2 #define avfilethread_HEADER_GUARD
97 AVFormatContext *input_context;
101 AVBitStreamFilterContext *annexb;
132 AVFormatContext *input_context;
133 std::vector<AVBitStreamFilterContext*> filters;
146 SlotNumber getSlot() {
return ctx.
slot;}
150 void seek(
long int ms_streamtime_);
153 long int update(
long int mstimestamp);
236 void handleSignals();
239 int safeGetSlot (SlotNumber slot,
FileStream*& stream);
FileSignal
Characteristic signals for the FileThread.
Definition: avfilethread.h:163
@ get_state
query information about the stream
Custom payload Frame.
Definition: frame.h:166
Passes frames to a FrameFifo.
Definition: framefilter.h:530
This class in analogous to the Connection class in live streams.
Definition: avfilethread.h:120
void seek(long int ms_streamtime_)
Seek to a desider stream time.
Definition: avfilethread.cpp:246
AVPacket * avpkt
Data for the next frame in ffmpeg AVPacket format.
Definition: avfilethread.h:143
void stop()
Stop playing the strem.
Definition: avfilethread.cpp:308
~FileStream()
Default destructor.
Definition: avfilethread.cpp:223
FileState state
Decribes the FileStream state: errors, stopped, playing, etc.
Definition: avfilethread.h:142
BasicFrame out_frame
This frame is written to the filterchain (i.e. to FileStream::ctx and there to FileContext::framefilt...
Definition: avfilethread.h:137
long int reftime
Relation between the stream time and wallclock time. See Presention timing and playing.
Definition: avfilethread.h:139
FileContext & ctx
FileContext describing this stream.
Definition: avfilethread.h:131
SetupFrame setupframe
Setup frame written to the filterchain.
Definition: avfilethread.h:136
FileStream(FileContext &ctx)
Default constructor.
Definition: avfilethread.cpp:151
void setRefMstime(long int ms_streamtime_)
Creates a correspondence with the current wallclock time and a desider stream time,...
Definition: avfilethread.cpp:241
long int frame_mstimestamp_
Timestamp of previous frame sent, -1 means there was no previous frame (underscore means stream time)
Definition: avfilethread.h:141
long int pullNextFrame()
Tries to achieve FileStream::target_mstimestamp_ . Sends frames whose timestamps are less than that t...
Definition: avfilethread.cpp:336
long int update(long int mstimestamp)
Tries to achieve mstimestamp: calculates FileStream::target_mstimestamp_ and calls pullNextFrame....
Definition: avfilethread.cpp:313
long int duration
Duration of the stream.
Definition: avfilethread.h:138
long int target_mstimestamp_
Where the stream would like to be (underscore means stream time)
Definition: avfilethread.h:140
void play()
Start playing the stream.
Definition: avfilethread.cpp:302
This class in analogous to LiveThread, but it handles files instead of live streams.
Definition: avfilethread.h:196
void closeFileStreamCall(FileContext &file_ctx)
API method: registers a stream // <pyapi>
Definition: avfilethread.cpp:768
void postRun()
Called after the main execution loop exits, but before joining the thread.
Definition: avfilethread.cpp:473
std::vector< FileStream * > slots_
Slots: a vector of FileStream instances.
Definition: avfilethread.h:215
~FileThread()
Default destructor.
Definition: avfilethread.cpp:451
std::deque< FileSignalContext > signal_fifo
Redefinition of signal fifo (Thread::signal_fifo is now hidden from usage)
Definition: avfilethread.h:212
bool loop
Controls the execution of the main loop.
Definition: avfilethread.h:218
void run()
Main execution loop is defined here.
Definition: avfilethread.cpp:545
std::list< SlotNumber > active_slots
Slots that are activated.
Definition: avfilethread.h:217
void playFileStreamCall(FileContext &file_ctx)
API method: starts playing the stream and feeding frames // <pyapi>
Definition: avfilethread.cpp:781
FileThread(const char *name, FrameFifoContext fifo_ctx=FrameFifoContext())
Default constructor.
Definition: avfilethread.cpp:446
FifoFrameFilter infilter
A FrameFilter for writing incoming frames.
Definition: avfilethread.h:209
FifoFrameFilter & getFrameFilter()
API method: get filter for sending frames with live555 // <pyapi>
Definition: avfilethread.cpp:813
FrameFifo infifo
A FrameFifo for incoming frames.
Definition: avfilethread.h:208
void openFileStreamCall(FileContext &file_ctx)
API method: de-registers a stream // <pyapi>
Definition: avfilethread.cpp:749
void stopFileStreamCall(FileContext &file_ctx)
API method: stops playing the stream and feeding frames // <pyapi>
Definition: avfilethread.cpp:787
void preRun()
Called before entering the main execution loop, but after creating the thread.
Definition: avfilethread.cpp:472
void seekFileStreamCall(FileContext &file_ctx)
API method: seek to a certain point // <pyapi>
Definition: avfilethread.cpp:774
void requestStopCall()
API method: Like Thread::stopCall() but does not block // <pyapi>
Definition: avfilethread.cpp:793
A thread-safe combination of a fifo (first-in-first-out) queue and an associated stack.
Definition: framefifo.h:83
The mother class of all frame filters! FrameFilters are used to create "filter chains".
Definition: framefilter.h:44
Setup frame.
Definition: frame.h:277
Definition: avfilethread.h:87
void pull()
Definition: avfilethread.cpp:102
~TestFileStream()
Default destructor.
Definition: avfilethread.cpp:86
TestFileStream(const char *filename)
Default constructor.
Definition: avfilethread.cpp:36
AVPacket * avpkt
Data for the next frame in ffmpeg AVPacket format.
Definition: avfilethread.h:100
A class for multithreading with a signaling system.
Definition: thread.h:87
std::string name
Name of the thread.
Definition: thread.h:116
Definition of FrameFilter and derived classes for various purposes.
FileState
Describes the state of a FileStream.
Definition: avfilethread.h:51
This class descibes the origin and state of a FileStream.
Definition: avfilethread.h:68
FrameFilter * framefilter
incoming: the frames are feeded into this FrameFilter // <pyapi>
Definition: avfilethread.h:78
long int seektime_
incoming: used by signal seek_stream // <pyapi>
Definition: avfilethread.h:79
FileState status
outgoing: status of the file // <pyapi>
Definition: avfilethread.h:82
FileContext()
Dummy constructor. Set values by manipulating members // <pyapi>
Definition: avfilethread.h:73
long int mstimestamp
outgoing: current position of the stream (stream time) // <pyapi>
Definition: avfilethread.h:81
std::string filename
incoming: the filename // <pyapi>
Definition: avfilethread.h:76
FileContext(std::string filename, SlotNumber slot, FrameFilter *framefilter, long int st=0)
Default constructor // <pyapi>
Definition: avfilethread.h:69
long int duration
outgoing: duration of the stream // <pyapi>
Definition: avfilethread.h:80
SlotNumber slot
incoming: a unique stream slot that identifies this stream // <pyapi>
Definition: avfilethread.h:77
Identifies the information the signals FileSignal carry.
Definition: avfilethread.h:178
FileContext * file_context
pointer, cause we have return values
Definition: avfilethread.h:180
Describes the stack structure and fifo behaviour for a FrameFifo.
Definition: framefifo.h:56
Base class for multithreading.
@ none
undefined (initial value)
Definition: usbthread.h:143