/third_party/ffmpeg/libavformat/ |
D | musx.c | 69 st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; in musx_read_header() 70 st->codecpar->codec_id = AV_CODEC_ID_ADPCM_PSX; in musx_read_header() 71 st->codecpar->channels = 2; in musx_read_header() 72 st->codecpar->sample_rate = 32000; in musx_read_header() 73 st->codecpar->block_align = 0x80 * st->codecpar->channels; in musx_read_header() 76 st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; in musx_read_header() 80 st->codecpar->channels = 2; in musx_read_header() 81 st->codecpar->sample_rate = 44100; in musx_read_header() 87 st->codecpar->channels = avio_rl32(s->pb); in musx_read_header() 88 if (st->codecpar->channels <= 0 || in musx_read_header() [all …]
|
D | genh.c | 56 st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; in genh_read_header() 57 st->codecpar->channels = avio_rl32(s->pb); in genh_read_header() 58 if (st->codecpar->channels <= 0 || st->codecpar->channels > FF_SANE_NB_CHANNELS) in genh_read_header() 60 if (st->codecpar->channels == 1) in genh_read_header() 61 st->codecpar->channel_layout = AV_CH_LAYOUT_MONO; in genh_read_header() 62 else if (st->codecpar->channels == 2) in genh_read_header() 63 st->codecpar->channel_layout = AV_CH_LAYOUT_STEREO; in genh_read_header() 66 if (align < 0 || align > INT_MAX / st->codecpar->channels) in genh_read_header() 68 st->codecpar->block_align = align * st->codecpar->channels; in genh_read_header() 69 st->codecpar->sample_rate = avio_rl32(s->pb); in genh_read_header() [all …]
|
D | msf.c | 55 st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; in msf_read_header() 57 st->codecpar->channels = avio_rb32(s->pb); in msf_read_header() 58 if (st->codecpar->channels <= 0 || st->codecpar->channels >= INT_MAX / 1024) in msf_read_header() 61 st->codecpar->sample_rate = avio_rb32(s->pb); in msf_read_header() 62 if (st->codecpar->sample_rate <= 0) in msf_read_header() 66 case 0: st->codecpar->codec_id = AV_CODEC_ID_PCM_S16BE; break; in msf_read_header() 67 case 1: st->codecpar->codec_id = AV_CODEC_ID_PCM_S16LE; break; in msf_read_header() 68 case 3: st->codecpar->block_align = 16 * st->codecpar->channels; in msf_read_header() 69 st->codecpar->codec_id = AV_CODEC_ID_ADPCM_PSX; break; in msf_read_header() 72 …case 6: st->codecpar->block_align = (codec == 4 ? 96 : codec == 5 ? 152 : 192) * st->codecpar->cha… in msf_read_header() [all …]
|
D | xwma.c | 78 ret = ff_get_wav_header(s, pb, st->codecpar, size, 0); in xwma_read_header() 87 if (st->codecpar->codec_id == AV_CODEC_ID_WMAV2) { in xwma_read_header() 88 int ch = st->codecpar->channels; in xwma_read_header() 89 int sr = st->codecpar->sample_rate; in xwma_read_header() 90 int br = st->codecpar->bit_rate; in xwma_read_header() 107 st->codecpar->bit_rate = br; in xwma_read_header() 112 if (st->codecpar->codec_id != AV_CODEC_ID_WMAV2 && in xwma_read_header() 113 st->codecpar->codec_id != AV_CODEC_ID_WMAPRO) { in xwma_read_header() 115 av_fourcc2str(st->codecpar->codec_tag), in xwma_read_header() 116 st->codecpar->codec_id); in xwma_read_header() [all …]
|
D | iff.c | 279 st->codecpar->channels = avio_rb16(pb); in parse_dsd_prop() 280 if (size < 2 + st->codecpar->channels * 4) in parse_dsd_prop() 282 st->codecpar->channel_layout = 0; in parse_dsd_prop() 283 if (st->codecpar->channels > FF_ARRAY_ELEMS(dsd_layout)) { in parse_dsd_prop() 287 for (i = 0; i < st->codecpar->channels; i++) in parse_dsd_prop() 291 if (av_get_channel_layout_nb_channels(d->layout) == st->codecpar->channels && in parse_dsd_prop() 292 !memcmp(d->dsd_layout, dsd_layout, st->codecpar->channels * sizeof(uint32_t))) { in parse_dsd_prop() 293 st->codecpar->channel_layout = d->layout; in parse_dsd_prop() 302 st->codecpar->codec_tag = tag = avio_rl32(pb); in parse_dsd_prop() 303 st->codecpar->codec_id = ff_codec_get_id(dsd_codec_tags, tag); in parse_dsd_prop() [all …]
|
D | dsfdec.c | 106 st->codecpar->channel_layout = dsf_channel_layout[channel_type]; in dsf_read_header() 107 if (!st->codecpar->channel_layout) in dsf_read_header() 110 st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; in dsf_read_header() 111 st->codecpar->channels = avio_rl32(pb); in dsf_read_header() 112 st->codecpar->sample_rate = avio_rl32(pb) / 8; in dsf_read_header() 114 if (st->codecpar->channels <= 0) in dsf_read_header() 118 case 1: st->codecpar->codec_id = AV_CODEC_ID_DSD_LSBF_PLANAR; break; in dsf_read_header() 119 case 8: st->codecpar->codec_id = AV_CODEC_ID_DSD_MSBF_PLANAR; break; in dsf_read_header() 125 dsf->audio_size = avio_rl64(pb) / 8 * st->codecpar->channels; in dsf_read_header() 126 st->codecpar->block_align = avio_rl32(pb); in dsf_read_header() [all …]
|
D | rpl.c | 152 vst->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; in rpl_read_header() 153 vst->codecpar->codec_tag = video_format; in rpl_read_header() 154 vst->codecpar->width = read_line_and_int(pb, &error); // video width in rpl_read_header() 155 vst->codecpar->height = read_line_and_int(pb, &error); // video height in rpl_read_header() 156 … vst->codecpar->bits_per_coded_sample = read_line_and_int(pb, &error); // video bits per sample in rpl_read_header() 159 switch (vst->codecpar->codec_tag) { in rpl_read_header() 162 vst->codecpar->codec_id = AV_CODEC_ID_ESCAPE122; in rpl_read_header() 166 vst->codecpar->codec_id = AV_CODEC_ID_ESCAPE124; in rpl_read_header() 168 vst->codecpar->bits_per_coded_sample = 16; in rpl_read_header() 171 vst->codecpar->codec_id = AV_CODEC_ID_ESCAPE130; in rpl_read_header() [all …]
|
D | nistspheredec.c | 46 st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; in nist_read_header() 61 if (!st->codecpar->bits_per_coded_sample) in nist_read_header() 62 st->codecpar->bits_per_coded_sample = bps << 3; in nist_read_header() 65 if (st->codecpar->codec_id == AV_CODEC_ID_NONE) in nist_read_header() 66 … st->codecpar->codec_id = ff_get_pcm_codec_id(st->codecpar->bits_per_coded_sample, in nist_read_header() 69 st->codecpar->codec_id = AV_CODEC_ID_PCM_ALAW; in nist_read_header() 72 st->codecpar->codec_id = AV_CODEC_ID_PCM_MULAW; in nist_read_header() 74 st->codecpar->codec_id = AV_CODEC_ID_SHORTEN; in nist_read_header() 75 if (ff_alloc_extradata(st->codecpar, 1)) in nist_read_header() 76 st->codecpar->extradata[0] = 1; in nist_read_header() [all …]
|
D | oggparseogm.c | 57 st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; in ogm_header() 60 st->codecpar->codec_id = ff_codec_get_id(ff_codec_bmp_tags, tag); in ogm_header() 61 st->codecpar->codec_tag = tag; in ogm_header() 62 if (st->codecpar->codec_id == AV_CODEC_ID_MPEG4) in ogm_header() 65 st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE; in ogm_header() 66 st->codecpar->codec_id = AV_CODEC_ID_TEXT; in ogm_header() 71 st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; in ogm_header() 76 st->codecpar->codec_id = ff_codec_get_id(ff_codec_wav_tags, cid); in ogm_header() 78 if (st->codecpar->codec_id != AV_CODEC_ID_AAC) in ogm_header() 94 if(st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO){ in ogm_header() [all …]
|
D | bintext.c | 57 st->codecpar->codec_tag = 0; in init_stream() 58 st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; in init_stream() 61 st->codecpar->width = (80<<3); in init_stream() 62 st->codecpar->height = (25<<4); in init_stream() 184 st->codecpar->codec_id = AV_CODEC_ID_BINTEXT; in bintext_read_header() 186 if ((ret = ff_alloc_extradata(st->codecpar, 2)) < 0) in bintext_read_header() 188 st->codecpar->extradata[0] = 16; in bintext_read_header() 189 st->codecpar->extradata[1] = 0; in bintext_read_header() 197 predict_width(st->codecpar, bin->fsize, got_width); in bintext_read_header() 198 if (st->codecpar->width < 8) in bintext_read_header() [all …]
|
D | sierravmd.c | 121 vst->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; in vmd_read_header() 122 vst->codecpar->codec_id = vmd->is_indeo3 ? AV_CODEC_ID_INDEO3 : AV_CODEC_ID_VMDVIDEO; in vmd_read_header() 123 vst->codecpar->codec_tag = 0; /* no fourcc */ in vmd_read_header() 124 vst->codecpar->width = width; in vmd_read_header() 125 vst->codecpar->height = height; in vmd_read_header() 126 if(vmd->is_indeo3 && vst->codecpar->width > 320){ in vmd_read_header() 127 vst->codecpar->width >>= 1; in vmd_read_header() 128 vst->codecpar->height >>= 1; in vmd_read_header() 130 if ((ret = ff_alloc_extradata(vst->codecpar, VMD_HEADER_SIZE)) < 0) in vmd_read_header() 132 memcpy(vst->codecpar->extradata, vmd->vmd_header, VMD_HEADER_SIZE); in vmd_read_header() [all …]
|
D | soxdec.c | 58 st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; in sox_read_header() 61 st->codecpar->codec_id = AV_CODEC_ID_PCM_S32LE; in sox_read_header() 65 st->codecpar->channels = avio_rl32(pb); in sox_read_header() 68 st->codecpar->codec_id = AV_CODEC_ID_PCM_S32BE; in sox_read_header() 72 st->codecpar->channels = avio_rb32(pb); in sox_read_header() 93 … || st->codecpar->channels > 65535 || st->codecpar->channels <= 0) /* Reserve top 16 bits */ { in sox_read_header() 114 st->codecpar->sample_rate = sample_rate; in sox_read_header() 115 st->codecpar->bits_per_coded_sample = 32; in sox_read_header() 116 st->codecpar->bit_rate = (int64_t)st->codecpar->sample_rate * in sox_read_header() 117 st->codecpar->bits_per_coded_sample * in sox_read_header() [all …]
|
D | apc.c | 50 st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; in apc_read_header() 51 st->codecpar->codec_id = AV_CODEC_ID_ADPCM_IMA_APC; in apc_read_header() 54 st->codecpar->sample_rate = avio_rl32(pb); in apc_read_header() 57 if ((ret = ff_get_extradata(s, st->codecpar, pb, 2 * 4)) < 0) in apc_read_header() 61 st->codecpar->channels = 2; in apc_read_header() 62 st->codecpar->channel_layout = AV_CH_LAYOUT_STEREO; in apc_read_header() 64 st->codecpar->channels = 1; in apc_read_header() 65 st->codecpar->channel_layout = AV_CH_LAYOUT_MONO; in apc_read_header() 68 st->codecpar->bits_per_coded_sample = 4; in apc_read_header() 69 st->codecpar->bit_rate = (int64_t)st->codecpar->bits_per_coded_sample * st->codecpar->channels in apc_read_header() [all …]
|
D | avisynth.c | 241 st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; in avisynth_create_stream_video() 242 st->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO; in avisynth_create_stream_video() 243 st->codecpar->width = avs->vi->width; in avisynth_create_stream_video() 244 st->codecpar->height = avs->vi->height; in avisynth_create_stream_video() 260 st->codecpar->field_order = AV_FIELD_UNKNOWN; in avisynth_create_stream_video() 263 st->codecpar->field_order = AV_FIELD_TT; in avisynth_create_stream_video() 266 st->codecpar->field_order = AV_FIELD_BB; in avisynth_create_stream_video() 273 st->codecpar->format = AV_PIX_FMT_YUV444P10; in avisynth_create_stream_video() 277 st->codecpar->format = AV_PIX_FMT_YUV422P10; in avisynth_create_stream_video() 281 st->codecpar->format = AV_PIX_FMT_YUV420P10; in avisynth_create_stream_video() [all …]
|
D | dcstr.c | 43 st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; in dcstr_read_header() 44 st->codecpar->channels = avio_rl32(s->pb); in dcstr_read_header() 45 st->codecpar->sample_rate = avio_rl32(s->pb); in dcstr_read_header() 46 if (st->codecpar->sample_rate <= 0) in dcstr_read_header() 53 if (st->codecpar->channels <= 0 || mult <= 0 || mult > INT_MAX / st->codecpar->channels) { in dcstr_read_header() 54 … av_log(s, AV_LOG_ERROR, "invalid number of channels %d x %d\n", st->codecpar->channels, mult); in dcstr_read_header() 57 st->codecpar->channels *= mult; in dcstr_read_header() 58 if (!align || align > INT_MAX / st->codecpar->channels) in dcstr_read_header() 60 st->codecpar->block_align = align * st->codecpar->channels; in dcstr_read_header() 63 case 4: st->codecpar->codec_id = AV_CODEC_ID_ADPCM_AICA; break; in dcstr_read_header() [all …]
|
D | tmv.c | 84 ast->codecpar->sample_rate = avio_rl16(pb); in tmv_read_header() 85 if (!ast->codecpar->sample_rate) { in tmv_read_header() 114 ast->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; in tmv_read_header() 115 ast->codecpar->codec_id = AV_CODEC_ID_PCM_U8; in tmv_read_header() 117 ast->codecpar->channels = 2; in tmv_read_header() 118 ast->codecpar->channel_layout = AV_CH_LAYOUT_STEREO; in tmv_read_header() 120 ast->codecpar->channels = 1; in tmv_read_header() 121 ast->codecpar->channel_layout = AV_CH_LAYOUT_MONO; in tmv_read_header() 123 ast->codecpar->bits_per_coded_sample = 8; in tmv_read_header() 124 ast->codecpar->bit_rate = ast->codecpar->sample_rate * in tmv_read_header() [all …]
|
D | nuv.c | 86 if ((ret = ff_get_extradata(NULL, vst->codecpar, pb, size)) < 0) in get_codec_data() 100 vst->codecpar->codec_tag = avio_rl32(pb); in get_codec_data() 101 vst->codecpar->codec_id = in get_codec_data() 102 ff_codec_get_id(ff_codec_bmp_tags, vst->codecpar->codec_tag); in get_codec_data() 103 if (vst->codecpar->codec_tag == MKTAG('R', 'J', 'P', 'G')) in get_codec_data() 104 vst->codecpar->codec_id = AV_CODEC_ID_NUV; in get_codec_data() 111 ast->codecpar->codec_tag = avio_rl32(pb); in get_codec_data() 112 ast->codecpar->sample_rate = avio_rl32(pb); in get_codec_data() 113 if (ast->codecpar->sample_rate <= 0) { in get_codec_data() 114 av_log(s, AV_LOG_ERROR, "Invalid sample rate %d\n", ast->codecpar->sample_rate); in get_codec_data() [all …]
|
D | ads.c | 46 st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; in ads_read_header() 48 st->codecpar->sample_rate = avio_rl32(s->pb); in ads_read_header() 49 if (st->codecpar->sample_rate <= 0) in ads_read_header() 51 st->codecpar->channels = avio_rl32(s->pb); in ads_read_header() 52 if (st->codecpar->channels <= 0) in ads_read_header() 55 if (align <= 0 || align > INT_MAX / st->codecpar->channels) in ads_read_header() 59 st->codecpar->codec_id = AV_CODEC_ID_PCM_S16LE_PLANAR; in ads_read_header() 61 st->codecpar->codec_id = AV_CODEC_ID_ADPCM_PSX; in ads_read_header() 63 st->codecpar->block_align = st->codecpar->channels * align; in ads_read_header() 66 if (st->codecpar->codec_id == AV_CODEC_ID_ADPCM_PSX && size >= 0x40) in ads_read_header() [all …]
|
D | flic.c | 112 st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; in flic_read_header() 113 st->codecpar->codec_id = AV_CODEC_ID_FLIC; in flic_read_header() 114 st->codecpar->codec_tag = 0; /* no fourcc */ in flic_read_header() 115 st->codecpar->width = AV_RL16(&header[0x08]); in flic_read_header() 116 st->codecpar->height = AV_RL16(&header[0x0A]); in flic_read_header() 118 if (!st->codecpar->width || !st->codecpar->height) { in flic_read_header() 123 st->codecpar->width = 640; in flic_read_header() 124 st->codecpar->height = 480; in flic_read_header() 128 if ((ret = ff_alloc_extradata(st->codecpar, FLIC_HEADER_SIZE)) < 0) in flic_read_header() 130 memcpy(st->codecpar->extradata, header, FLIC_HEADER_SIZE); in flic_read_header() [all …]
|
D | codec2.c | 126 int mode = codec2_mode_from_extradata(st->codecpar->extradata); in codec2_read_header_common() 128 st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; in codec2_read_header_common() 129 st->codecpar->codec_id = AV_CODEC_ID_CODEC2; in codec2_read_header_common() 130 st->codecpar->sample_rate = 8000; in codec2_read_header_common() 131 st->codecpar->channels = 1; in codec2_read_header_common() 132 st->codecpar->format = AV_SAMPLE_FMT_S16; in codec2_read_header_common() 133 st->codecpar->channel_layout = AV_CH_LAYOUT_MONO; in codec2_read_header_common() 134 st->codecpar->bit_rate = codec2_mode_bit_rate(s, mode); in codec2_read_header_common() 135 st->codecpar->frame_size = codec2_mode_frame_size(s, mode); in codec2_read_header_common() 136 st->codecpar->block_align = codec2_mode_block_align(s, mode); in codec2_read_header_common() [all …]
|
D | mvi.c | 58 if ((ret = ff_alloc_extradata(vst->codecpar, 2)) < 0) in read_header() 62 vst->codecpar->extradata[0] = avio_r8(pb); in read_header() 63 vst->codecpar->extradata[1] = avio_r8(pb); in read_header() 66 vst->codecpar->width = avio_rl16(pb); in read_header() 67 vst->codecpar->height = avio_rl16(pb); in read_header() 69 ast->codecpar->sample_rate = avio_rl16(pb); in read_header() 84 avpriv_set_pts_info(ast, 64, 1, ast->codecpar->sample_rate); in read_header() 85 ast->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; in read_header() 86 ast->codecpar->codec_id = AV_CODEC_ID_PCM_U8; in read_header() 87 ast->codecpar->channels = 1; in read_header() [all …]
|
D | aiffdec.c | 96 AVCodecParameters *par = s->streams[0]->codecpar; in get_aiff_header() 242 if (size == AVERROR_EOF && offset > 0 && st->codecpar->block_align) { in aiff_read_header() 298 …if (st->codecpar->block_align && !(pb->seekable & AVIO_SEEKABLE_NORMAL)) /* Assume COMM already… in aiff_read_header() 309 if ((ret = ff_get_extradata(s, st->codecpar, pb, size)) < 0) in aiff_read_header() 311 … if ( (st->codecpar->codec_id == AV_CODEC_ID_QDMC || st->codecpar->codec_id == AV_CODEC_ID_QDM2) in aiff_read_header() 312 && size>=12*4 && !st->codecpar->block_align) { in aiff_read_header() 313 st->codecpar->block_align = AV_RB32(st->codecpar->extradata+11*4); in aiff_read_header() 314 aiff->block_duration = AV_RB32(st->codecpar->extradata+9*4); in aiff_read_header() 315 } else if (st->codecpar->codec_id == AV_CODEC_ID_QCELP) { in aiff_read_header() 318 rate = st->codecpar->extradata[24]; in aiff_read_header() [all …]
|
D | svag.c | 45 st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; in svag_read_header() 46 st->codecpar->codec_id = AV_CODEC_ID_ADPCM_PSX; in svag_read_header() 47 st->codecpar->sample_rate = avio_rl32(s->pb); in svag_read_header() 48 if (st->codecpar->sample_rate <= 0) in svag_read_header() 50 st->codecpar->channels = avio_rl32(s->pb); in svag_read_header() 51 if (st->codecpar->channels <= 0 || st->codecpar->channels > 8) in svag_read_header() 53 st->duration = size / (16 * st->codecpar->channels) * 28; in svag_read_header() 55 if (align <= 0 || align > INT_MAX / st->codecpar->channels) in svag_read_header() 57 st->codecpar->block_align = align * st->codecpar->channels; in svag_read_header() 59 avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate); in svag_read_header() [all …]
|
D | iss.c | 110 st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; in iss_read_header() 111 st->codecpar->codec_id = AV_CODEC_ID_ADPCM_IMA_ISS; in iss_read_header() 113 st->codecpar->channels = 2; in iss_read_header() 114 st->codecpar->channel_layout = AV_CH_LAYOUT_STEREO; in iss_read_header() 116 st->codecpar->channels = 1; in iss_read_header() 117 st->codecpar->channel_layout = AV_CH_LAYOUT_MONO; in iss_read_header() 119 st->codecpar->sample_rate = 44100; in iss_read_header() 121 st->codecpar->sample_rate /= rate_divisor; in iss_read_header() 122 st->codecpar->bits_per_coded_sample = 4; in iss_read_header() 123 st->codecpar->bit_rate = st->codecpar->channels * st->codecpar->sample_rate in iss_read_header() [all …]
|
D | idroqdec.c | 133 st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; in roq_read_packet() 134 st->codecpar->codec_id = AV_CODEC_ID_ROQ; in roq_read_packet() 135 st->codecpar->codec_tag = 0; /* no fourcc */ in roq_read_packet() 139 st->codecpar->width = roq->width = AV_RL16(preamble); in roq_read_packet() 140 st->codecpar->height = roq->height = AV_RL16(preamble + 2); in roq_read_packet() 184 st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; in roq_read_packet() 185 st->codecpar->codec_id = AV_CODEC_ID_ROQ_DPCM; in roq_read_packet() 186 st->codecpar->codec_tag = 0; /* no tag */ in roq_read_packet() 188 st->codecpar->channels = 2; in roq_read_packet() 189 st->codecpar->channel_layout = AV_CH_LAYOUT_STEREO; in roq_read_packet() [all …]
|