1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

For #299, refine the codec to format-frame-sample chain.

This commit is contained in:
winlin 2017-02-12 18:18:18 +08:00
parent c4a510b834
commit d7458c4e72
18 changed files with 990 additions and 1150 deletions

View file

@ -30,32 +30,33 @@
#include <srs_core.hpp>
class SrsFrame;
#include <srs_kernel_codec.hpp>
class SrsBuffer;
class SrsAudioFrame;
class SrsVideoFrame;
class SrsAudioCodec;
class SrsVideoCodec;
class SrsOnMetaDataPacket;
class SrsSharedPtrMessage;
/**
* A codec format, including one or many stream, each stream identified by a frame.
* For example, a typical RTMP stream format, consits of a video and audio frame.
* Maybe some RTMP stream only has a audio stream, for instance, redio application.
* Create special structure from RTMP stream, for example, the metadata.
*/
class SrsFormat
class SrsRtmpFormat : public SrsFormat
{
public:
SrsFrame* audio;
SrsFrame* video;
SrsRtmpFormat();
virtual ~SrsRtmpFormat();
public:
SrsFormat();
virtual ~SrsFormat();
public:
// Initialize the format.
virtual int initialize();
// Initialize the format from metadata, optional.
virtual int on_metadata(SrsOnMetaDataPacket* meta);
// When got a parsed audio packet.
virtual int on_audio(SrsSharedPtrMessage* shared_audio);
virtual int on_audio(int64_t timestamp, char* data, int size);
// When got a parsed video packet.
virtual int on_video(SrsSharedPtrMessage* shared_video, bool is_sequence_header);
virtual int on_video(SrsSharedPtrMessage* shared_video);
virtual int on_video(int64_t timestamp, char* data, int size);
};
#endif