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

Refine typo in protocol.

This commit is contained in:
winlin 2019-04-23 08:06:50 +08:00
parent 35fe05d62c
commit 8bc77387ff
7 changed files with 1328 additions and 2117 deletions

View file

@ -32,61 +32,45 @@
class SrsBuffer;
/**
* the raw h.264 stream, in annexb.
*/
// The raw h.264 stream, in annexb.
class SrsRawH264Stream
{
public:
SrsRawH264Stream();
virtual ~SrsRawH264Stream();
public:
/**
* demux the stream in annexb format.
* @param stream the input stream bytes.
* @param pframe the output h.264 frame in stream. user should never free it.
* @param pnb_frame the output h.264 frame size.
*/
// Demux the stream in annexb format.
// @param stream the input stream bytes.
// @param pframe the output h.264 frame in stream. user should never free it.
// @param pnb_frame the output h.264 frame size.
virtual srs_error_t annexb_demux(SrsBuffer* stream, char** pframe, int* pnb_frame);
/**
* whether the frame is sps or pps.
*/
// whether the frame is sps or pps.
virtual bool is_sps(char* frame, int nb_frame);
virtual bool is_pps(char* frame, int nb_frame);
/**
* demux the sps or pps to string.
* @param sps/pps output the sps/pps.
*/
// Demux the sps or pps to string.
// @param sps/pps output the sps/pps.
virtual srs_error_t sps_demux(char* frame, int nb_frame, std::string& sps);
virtual srs_error_t pps_demux(char* frame, int nb_frame, std::string& pps);
public:
/**
* h264 raw data to h264 packet, without flv payload header.
* mux the sps/pps to flv sequence header packet.
* @param sh output the sequence header.
*/
// The h264 raw data to h264 packet, without flv payload header.
// Mux the sps/pps to flv sequence header packet.
// @param sh output the sequence header.
virtual srs_error_t mux_sequence_header(std::string sps, std::string pps, uint32_t dts, uint32_t pts, std::string& sh);
/**
* h264 raw data to h264 packet, without flv payload header.
* mux the ibp to flv ibp packet.
* @param ibp output the packet.
* @param frame_type output the frame type.
*/
// The h264 raw data to h264 packet, without flv payload header.
// Mux the ibp to flv ibp packet.
// @param ibp output the packet.
// @param frame_type output the frame type.
virtual srs_error_t mux_ipb_frame(char* frame, int nb_frame, std::string& ibp);
/**
* mux the avc video packet to flv video packet.
* @param frame_type, SrsVideoAvcFrameTypeKeyFrame or SrsVideoAvcFrameTypeInterFrame.
* @param avc_packet_type, SrsVideoAvcFrameTraitSequenceHeader or SrsVideoAvcFrameTraitNALU.
* @param video the h.264 raw data.
* @param flv output the muxed flv packet.
* @param nb_flv output the muxed flv size.
*/
// Mux the avc video packet to flv video packet.
// @param frame_type, SrsVideoAvcFrameTypeKeyFrame or SrsVideoAvcFrameTypeInterFrame.
// @param avc_packet_type, SrsVideoAvcFrameTraitSequenceHeader or SrsVideoAvcFrameTraitNALU.
// @param video the h.264 raw data.
// @param flv output the muxed flv packet.
// @param nb_flv output the muxed flv size.
virtual srs_error_t mux_avc2flv(std::string video, int8_t frame_type, int8_t avc_packet_type, uint32_t dts, uint32_t pts, char** flv, int* nb_flv);
};
/**
* the header of adts sample.
*/
// The header of adts sample.
struct SrsRawAacStreamCodec
{
int8_t protection_absent;
@ -103,37 +87,29 @@ struct SrsRawAacStreamCodec
int8_t aac_packet_type;
};
/**
* the raw aac stream, in adts.
*/
// The raw aac stream, in adts.
class SrsRawAacStream
{
public:
SrsRawAacStream();
virtual ~SrsRawAacStream();
public:
/**
* demux the stream in adts format.
* @param stream the input stream bytes.
* @param pframe the output aac frame in stream. user should never free it.
* @param pnb_frame the output aac frame size.
* @param codec the output codec info.
*/
// Demux the stream in adts format.
// @param stream the input stream bytes.
// @param pframe the output aac frame in stream. user should never free it.
// @param pnb_frame the output aac frame size.
// @param codec the output codec info.
virtual srs_error_t adts_demux(SrsBuffer* stream, char** pframe, int* pnb_frame, SrsRawAacStreamCodec& codec);
/**
* aac raw data to aac packet, without flv payload header.
* mux the aac specific config to flv sequence header packet.
* @param sh output the sequence header.
*/
// Mux aac raw data to aac packet, without flv payload header.
// Mux the aac specific config to flv sequence header packet.
// @param sh output the sequence header.
virtual srs_error_t mux_sequence_header(SrsRawAacStreamCodec* codec, std::string& sh);
/**
* mux the aac audio packet to flv audio packet.
* @param frame the aac raw data.
* @param nb_frame the count of aac frame.
* @param codec the codec info of aac.
* @param flv output the muxed flv packet.
* @param nb_flv output the muxed flv size.
*/
// Mux the aac audio packet to flv audio packet.
// @param frame the aac raw data.
// @param nb_frame the count of aac frame.
// @param codec the codec info of aac.
// @param flv output the muxed flv packet.
// @param nb_flv output the muxed flv size.
virtual srs_error_t mux_aac2flv(char* frame, int nb_frame, SrsRawAacStreamCodec* codec, uint32_t dts, char** flv, int* nb_flv);
};