Merge commit 'b8df0b71c525e9fc9fbee790d093bae3aa62035c'
* commit 'b8df0b71c525e9fc9fbee790d093bae3aa62035c': rtp: h264: Move profile_level_id parsing to a function Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
		
						commit
						3773b6edea
					
				@ -64,30 +64,10 @@ struct PayloadContext {
 | 
			
		||||
 | 
			
		||||
static const uint8_t start_sequence[] = { 0, 0, 0, 1 };
 | 
			
		||||
 | 
			
		||||
static int sdp_parse_fmtp_config_h264(AVFormatContext *s,
 | 
			
		||||
                                      AVStream *stream,
 | 
			
		||||
static void parse_profile_level_id(AVFormatContext *s,
 | 
			
		||||
                                   PayloadContext *h264_data,
 | 
			
		||||
                                      char *attr, char *value)
 | 
			
		||||
                                   char *value)
 | 
			
		||||
{
 | 
			
		||||
    AVCodecContext *codec = stream->codec;
 | 
			
		||||
    assert(codec->codec_id == AV_CODEC_ID_H264);
 | 
			
		||||
    assert(h264_data);
 | 
			
		||||
 | 
			
		||||
    if (!strcmp(attr, "packetization-mode")) {
 | 
			
		||||
        av_log(s, AV_LOG_DEBUG, "RTP Packetization Mode: %d\n", atoi(value));
 | 
			
		||||
        h264_data->packetization_mode = atoi(value);
 | 
			
		||||
        /*
 | 
			
		||||
         * Packetization Mode:
 | 
			
		||||
         * 0 or not present: Single NAL mode (Only nals from 1-23 are allowed)
 | 
			
		||||
         * 1: Non-interleaved Mode: 1-23, 24 (STAP-A), 28 (FU-A) are allowed.
 | 
			
		||||
         * 2: Interleaved Mode: 25 (STAP-B), 26 (MTAP16), 27 (MTAP24), 28 (FU-A),
 | 
			
		||||
         *                      and 29 (FU-B) are allowed.
 | 
			
		||||
         */
 | 
			
		||||
        if (h264_data->packetization_mode > 1)
 | 
			
		||||
            av_log(s, AV_LOG_ERROR,
 | 
			
		||||
                   "Interleaved RTP mode is not supported yet.\n");
 | 
			
		||||
    } else if (!strcmp(attr, "profile-level-id")) {
 | 
			
		||||
        if (strlen(value) == 6) {
 | 
			
		||||
    char buffer[3];
 | 
			
		||||
    // 6 characters=3 bytes, in hex.
 | 
			
		||||
    uint8_t profile_idc;
 | 
			
		||||
@ -112,6 +92,32 @@ static int sdp_parse_fmtp_config_h264(AVFormatContext *s,
 | 
			
		||||
    h264_data->profile_iop = profile_iop;
 | 
			
		||||
    h264_data->level_idc   = level_idc;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int sdp_parse_fmtp_config_h264(AVFormatContext *s,
 | 
			
		||||
                                      AVStream *stream,
 | 
			
		||||
                                      PayloadContext *h264_data,
 | 
			
		||||
                                      char *attr, char *value)
 | 
			
		||||
{
 | 
			
		||||
    AVCodecContext *codec = stream->codec;
 | 
			
		||||
    assert(codec->codec_id == AV_CODEC_ID_H264);
 | 
			
		||||
    assert(h264_data);
 | 
			
		||||
 | 
			
		||||
    if (!strcmp(attr, "packetization-mode")) {
 | 
			
		||||
        av_log(s, AV_LOG_DEBUG, "RTP Packetization Mode: %d\n", atoi(value));
 | 
			
		||||
        h264_data->packetization_mode = atoi(value);
 | 
			
		||||
        /*
 | 
			
		||||
         * Packetization Mode:
 | 
			
		||||
         * 0 or not present: Single NAL mode (Only nals from 1-23 are allowed)
 | 
			
		||||
         * 1: Non-interleaved Mode: 1-23, 24 (STAP-A), 28 (FU-A) are allowed.
 | 
			
		||||
         * 2: Interleaved Mode: 25 (STAP-B), 26 (MTAP16), 27 (MTAP24), 28 (FU-A),
 | 
			
		||||
         *                      and 29 (FU-B) are allowed.
 | 
			
		||||
         */
 | 
			
		||||
        if (h264_data->packetization_mode > 1)
 | 
			
		||||
            av_log(s, AV_LOG_ERROR,
 | 
			
		||||
                   "Interleaved RTP mode is not supported yet.\n");
 | 
			
		||||
    } else if (!strcmp(attr, "profile-level-id")) {
 | 
			
		||||
        if (strlen(value) == 6)
 | 
			
		||||
            parse_profile_level_id(s, h264_data, value);
 | 
			
		||||
    } else if (!strcmp(attr, "sprop-parameter-sets")) {
 | 
			
		||||
        codec->extradata_size = 0;
 | 
			
		||||
        av_freep(&codec->extradata);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user