Lines Matching defs:par
502 if (track->par->codec_id == AV_CODEC_ID_AC3) {
641 avio_write(pb, track->par->extradata, track->par->extradata_size);
642 return track->par->extradata_size;
708 } else if (track->par->bit_rate) {
709 bit_rates.avg_bit_rate = track->par->bit_rate;
716 bit_rates.max_bit_rate = FFMAX(track->par->bit_rate,
748 if ((track->par->codec_id == AV_CODEC_ID_MP2 ||
749 track->par->codec_id == AV_CODEC_ID_MP3) &&
750 track->par->sample_rate > 24000)
753 avio_w8(pb, ff_codec_get_tag(ff_mp4_obj_type, track->par->codec_id));
757 if (track->par->codec_id == AV_CODEC_ID_DVD_SUBTITLE)
759 else if (track->par->codec_type == AVMEDIA_TYPE_AUDIO)
802 track->par->codec_tag = av_bswap16(track->tag >> 16);
803 if ((ret = ff_put_wav_header(s, pb, track->par, 0)) < 0)
828 if (track->par->extradata_size != FLAC_STREAMINFO_SIZE)
833 avio_wb24(pb, track->par->extradata_size); /* Length */
834 avio_write(pb, track->par->extradata, track->par->extradata_size); /* BlockData[Length] */
846 if (track->par->extradata_size < 19) {
853 channels = AV_RB8(track->par->extradata + 9);
854 channel_map = AV_RB8(track->par->extradata + 18);
857 avio_wb16(pb, AV_RL16(track->par->extradata + 10)); /* PreSkip */
858 avio_wb32(pb, AV_RL32(track->par->extradata + 12)); /* InputSampleRate */
859 avio_wb16(pb, AV_RL16(track->par->extradata + 16)); /* OutputGain */
863 if (track->par->extradata_size < 21 + channels) {
867 avio_write(pb, track->par->extradata + 19, 2 + channels); /* ChannelMappingTable */
911 ret = ff_mov_get_channel_layout_tag(track->par, &layout_tag,
935 num_desc = layout_tag ? 0 : track->par->ch_layout.nb_channels;
965 if (track->par->codec_id != AV_CODEC_ID_QDM2) {
971 if (track->par->codec_id == AV_CODEC_ID_AAC) {
977 } else if (mov_pcm_le_gt16(track->par->codec_id)) {
979 } else if (mov_pcm_be_gt16(track->par->codec_id)) {
981 } else if (track->par->codec_id == AV_CODEC_ID_AMR_NB) {
983 } else if (track->par->codec_id == AV_CODEC_ID_AC3) {
985 } else if (track->par->codec_id == AV_CODEC_ID_EAC3) {
987 } else if (track->par->codec_id == AV_CODEC_ID_ALAC ||
988 track->par->codec_id == AV_CODEC_ID_QDM2) {
990 } else if (track->par->codec_id == AV_CODEC_ID_ADPCM_MS ||
991 track->par->codec_id == AV_CODEC_ID_ADPCM_IMA_WAV) {
1161 // return track->par->frame_size;
1205 if (track->timescale > UINT16_MAX || !track->par->ch_layout.nb_channels) {
1206 if (mov_get_lpcm_flags(track->par->codec_id))
1209 } else if (track->audio_vbr || mov_pcm_le_gt16(track->par->codec_id) ||
1210 mov_pcm_be_gt16(track->par->codec_id) ||
1211 track->par->codec_id == AV_CODEC_ID_ADPCM_MS ||
1212 track->par->codec_id == AV_CODEC_ID_ADPCM_IMA_WAV ||
1213 track->par->codec_id == AV_CODEC_ID_QDM2) {
1240 avio_wb64(pb, av_double2int(track->par->sample_rate));
1241 avio_wb32(pb, track->par->ch_layout.nb_channels);
1243 avio_wb32(pb, av_get_bits_per_sample(track->par->codec_id));
1244 avio_wb32(pb, mov_get_lpcm_flags(track->par->codec_id));
1249 avio_wb16(pb, track->par->ch_layout.nb_channels);
1250 if (track->par->codec_id == AV_CODEC_ID_PCM_U8 ||
1251 track->par->codec_id == AV_CODEC_ID_PCM_S8)
1253 else if (track->par->codec_id == AV_CODEC_ID_ADPCM_G726)
1254 avio_wb16(pb, track->par->bits_per_coded_sample);
1259 if (track->par->codec_id == AV_CODEC_ID_FLAC ||
1260 track->par->codec_id == AV_CODEC_ID_ALAC ||
1261 track->par->codec_id == AV_CODEC_ID_OPUS) {
1262 avio_wb16(pb, track->par->ch_layout.nb_channels);
1266 if (track->par->codec_id == AV_CODEC_ID_FLAC ||
1267 track->par->codec_id == AV_CODEC_ID_ALAC) {
1268 avio_wb16(pb, track->par->bits_per_raw_sample);
1276 if (track->par->codec_id == AV_CODEC_ID_OPUS)
1278 else if (track->par->codec_id == AV_CODEC_ID_TRUEHD)
1279 avio_wb32(pb, track->par->sample_rate);
1281 avio_wb16(pb, track->par->sample_rate <= UINT16_MAX ?
1282 track->par->sample_rate : 0);
1284 if (track->par->codec_id != AV_CODEC_ID_TRUEHD)
1289 if (mov_pcm_le_gt16(track->par->codec_id) ||
1290 mov_pcm_be_gt16(track->par->codec_id))
1293 avio_wb32(pb, track->par->frame_size); /* Samples per packet */
1294 avio_wb32(pb, track->sample_size / track->par->ch_layout.nb_channels); /* Bytes per packet */
1300 (track->par->codec_id == AV_CODEC_ID_AAC ||
1301 track->par->codec_id == AV_CODEC_ID_AC3 ||
1302 track->par->codec_id == AV_CODEC_ID_EAC3 ||
1303 track->par->codec_id == AV_CODEC_ID_AMR_NB ||
1304 track->par->codec_id == AV_CODEC_ID_ALAC ||
1305 track->par->codec_id == AV_CODEC_ID_ADPCM_MS ||
1306 track->par->codec_id == AV_CODEC_ID_ADPCM_IMA_WAV ||
1307 track->par->codec_id == AV_CODEC_ID_QDM2 ||
1308 (mov_pcm_le_gt16(track->par->codec_id) && version==1) ||
1309 (mov_pcm_be_gt16(track->par->codec_id) && version==1)))
1313 else if (track->par->codec_id == AV_CODEC_ID_AMR_NB)
1315 else if (track->par->codec_id == AV_CODEC_ID_AC3)
1317 else if (track->par->codec_id == AV_CODEC_ID_EAC3)
1319 else if (track->par->codec_id == AV_CODEC_ID_ALAC)
1321 else if (track->par->codec_id == AV_CODEC_ID_WMAPRO)
1323 else if (track->par->codec_id == AV_CODEC_ID_FLAC)
1325 else if (track->par->codec_id == AV_CODEC_ID_OPUS)
1327 else if (track->par->codec_id == AV_CODEC_ID_TRUEHD)
1335 if (track->mode == MODE_MOV && track->par->codec_type == AVMEDIA_TYPE_AUDIO
1393 ff_isom_write_vpcc(s, pb, track->par);
1415 int display_width = track->par->width;
1435 if (track->par->color_range == AVCOL_RANGE_MPEG || /* Legal range (16-235) */
1436 track->par->color_range == AVCOL_RANGE_UNSPECIFIED) {
1467 if ( track->par->sample_aspect_ratio.num > 0
1468 && track->par->sample_aspect_ratio.den > 0)
1469 display_width = display_width * track->par->sample_aspect_ratio.num / track->par->sample_aspect_ratio.den;
1473 avio_wb32(pb, track->par->height / 2);
1478 avio_wb32(pb, track->par->height);
1481 if (track->par->height == 1080)
1496 if (track->par->extradata_size >= 12 &&
1497 !memcmp(&track->par->extradata[4], "DpxE", 4)) {
1498 avio_wb32(pb, track->par->extradata[11]);
1509 if (track->par->width == 720) { /* SD */
1510 if (track->par->height == 480) { /* NTSC */
1511 if (track->par->format == AV_PIX_FMT_YUV422P) tag = MKTAG('d','v','5','n');
1513 }else if (track->par->format == AV_PIX_FMT_YUV422P) tag = MKTAG('d','v','5','p');
1514 else if (track->par->format == AV_PIX_FMT_YUV420P) tag = MKTAG('d','v','c','p');
1516 } else if (track->par->height == 720) { /* HD 720 line */
1519 } else if (track->par->height == 1080) { /* HD 1080 line */
1541 int tag = track->par->codec_tag;
1542 int interlaced = track->par->field_order > AV_FIELD_PROGRESSIVE;
1549 if (track->par->format == AV_PIX_FMT_YUV420P) {
1550 if (track->par->width == 1280 && track->par->height == 720) {
1558 } else if (track->par->width == 1440 && track->par->height == 1080) {
1567 } else if (track->par->width == 1920 && track->par->height == 1080) {
1577 } else if (track->par->format == AV_PIX_FMT_YUV422P) {
1578 if (track->par->width == 1280 && track->par->height == 720) {
1586 } else if (track->par->width == 1920 && track->par->height == 1080) {
1603 int tag = track->par->codec_tag;
1604 int interlaced = track->par->field_order > AV_FIELD_PROGRESSIVE;
1611 if (track->par->format == AV_PIX_FMT_YUV420P10) {
1612 if (track->par->width == 960 && track->par->height == 720) {
1620 } else if (track->par->width == 1440 && track->par->height == 1080) {
1630 } else if (track->par->format == AV_PIX_FMT_YUV422P10) {
1631 if (track->par->width == 1280 && track->par->height == 720) {
1639 } else if (track->par->width == 1920 && track->par->height == 1080) {
1649 } else if ( track->par->width == 4096 && track->par->height == 2160
1650 || track->par->width == 3840 && track->par->height == 2160
1651 || track->par->width == 2048 && track->par->height == 1080) {
1684 if (track->par->profile != FF_PROFILE_UNKNOWN &&
1685 track->par->profile != FF_PROFILE_DNXHD)
1692 int tag = track->par->codec_tag;
1697 if (track->par->format == mov_pix_fmt_tags[i].pix_fmt) {
1699 track->par->bits_per_coded_sample = mov_pix_fmt_tags[i].bps;
1700 if (track->par->codec_tag == mov_pix_fmt_tags[i].tag)
1706 track->par->bits_per_coded_sample);
1708 track->par->format != pix_fmt &&
1709 track->par->format != AV_PIX_FMT_GRAY8 &&
1710 track->par->format != AV_PIX_FMT_NONE)
1712 av_get_pix_fmt_name(track->par->format));
1718 unsigned int tag = track->par->codec_tag;
1725 (track->par->codec_id == AV_CODEC_ID_DVVIDEO ||
1726 track->par->codec_id == AV_CODEC_ID_RAWVIDEO ||
1727 track->par->codec_id == AV_CODEC_ID_H263 ||
1728 track->par->codec_id == AV_CODEC_ID_H264 ||
1729 track->par->codec_id == AV_CODEC_ID_DNXHD ||
1730 track->par->codec_id == AV_CODEC_ID_MPEG2VIDEO ||
1731 av_get_bits_per_sample(track->par->codec_id)))) { // pcm audio
1732 if (track->par->codec_id == AV_CODEC_ID_DVVIDEO)
1734 else if (track->par->codec_id == AV_CODEC_ID_RAWVIDEO)
1736 else if (track->par->codec_id == AV_CODEC_ID_MPEG2VIDEO)
1738 else if (track->par->codec_id == AV_CODEC_ID_H264)
1740 else if (track->par->codec_id == AV_CODEC_ID_DNXHD)
1742 else if (track->par->codec_type == AVMEDIA_TYPE_VIDEO) {
1743 tag = ff_codec_get_tag(ff_codec_movvideo_tags, track->par->codec_id);
1745 tag = ff_codec_get_tag(ff_codec_bmp_tags, track->par->codec_id);
1750 } else if (track->par->codec_type == AVMEDIA_TYPE_AUDIO) {
1751 tag = ff_codec_get_tag(ff_codec_movaudio_tags, track->par->codec_id);
1753 int ms_tag = ff_codec_get_tag(ff_codec_wav_tags, track->par->codec_id);
1760 } else if (track->par->codec_type == AVMEDIA_TYPE_SUBTITLE)
1761 tag = ff_codec_get_tag(ff_codec_movsubtitle_tags, track->par->codec_id);
1797 return ff_codec_get_tag(codec_cover_image_tags, track->par->codec_id);
1809 return validate_codec_tag(s->oformat->codec_tag, track->par->codec_tag,
1810 track->par->codec_id);
1857 if (track->par->codec_id == AV_CODEC_ID_DVD_SUBTITLE)
1859 else if (track->par->codec_id == AV_CODEC_ID_TTML) {
1860 switch (track->par->codec_tag) {
1877 av_fourcc2str(track->par->codec_tag), track->st->index,
1881 } else if (track->par->extradata_size)
1882 avio_write(pb, track->par->extradata, track->par->extradata_size);
2001 avio_wb32(pb, track->par->width); /* apertureWidth_N */
2015 av_reduce(&sar.num, &sar.den, track->par->sample_aspect_ratio.num,
2016 track->par->sample_aspect_ratio.den, INT_MAX);
2029 gamma = avpriv_get_gamma_from_trc(track->par->color_trc);
2086 avio_wb16(pb, track->par->color_primaries);
2087 avio_wb16(pb, track->par->color_trc);
2088 avio_wb16(pb, track->par->color_space);
2090 int full_range = track->par->color_range == AVCOL_RANGE_JPEG;
2168 int xdcam_res = (track->par->width == 1280 && track->par->height == 720)
2169 || (track->par->width == 1440 && track->par->height == 1080)
2170 || (track->par->width == 1920 && track->par->height == 1080);
2177 } else if (track->par->codec_id == AV_CODEC_ID_MPEG2VIDEO && xdcam_res) {
2178 int interlaced = track->par->field_order > AV_FIELD_PROGRESSIVE;
2182 if (track->par->format == AV_PIX_FMT_YUV422P) {
2184 } else if(track->par->width == 1440) {
2189 av_strlcatf(compressor_name, len, " %d%c", track->par->height, interlaced ? 'i' : 'p');
2340 int uncompressed_ycbcr = ((track->par->codec_id == AV_CODEC_ID_RAWVIDEO && track->par->format == AV_PIX_FMT_UYVY422)
2341 || (track->par->codec_id == AV_CODEC_ID_RAWVIDEO && track->par->format == AV_PIX_FMT_YUYV422)
2342 || track->par->codec_id == AV_CODEC_ID_V308
2343 || track->par->codec_id == AV_CODEC_ID_V408
2344 || track->par->codec_id == AV_CODEC_ID_V410
2345 || track->par->codec_id == AV_CODEC_ID_V210);
2365 if (track->par->codec_id == AV_CODEC_ID_RAWVIDEO || uncompressed_ycbcr) {
2375 avio_wb16(pb, track->par->width); /* Video width */
2385 if (cuva.cuva_version_map > 0 && track->par->codec_id == AV_CODEC_ID_HEVC) {
2394 (track->par->codec_id == AV_CODEC_ID_V410 || track->par->codec_id == AV_CODEC_ID_V210))
2396 else if (track->mode == MODE_MOV && track->par->bits_per_coded_sample)
2397 avio_wb16(pb, track->par->bits_per_coded_sample |
2398 (track->par->format == AV_PIX_FMT_GRAY8 ? 0x20 : 0));
2402 if (track->mode == MODE_MOV && track->par->format == AV_PIX_FMT_PAL8) {
2407 if (track->par->bits_per_coded_sample < 0 || track->par->bits_per_coded_sample > 8)
2409 pal_size = 1 << track->par->bits_per_coded_sample;
2426 else if (track->par->codec_id == AV_CODEC_ID_H263)
2428 else if (track->par->codec_id == AV_CODEC_ID_AVUI ||
2429 track->par->codec_id == AV_CODEC_ID_SVQ3) {
2432 } else if (track->par->codec_id == AV_CODEC_ID_DNXHD) {
2435 } else if (track->par->codec_id == AV_CODEC_ID_HEVC)
2437 else if (track->par->codec_id == AV_CODEC_ID_H264 && !TAG_IS_AVCI(track->tag)) {
2441 } else if (track->par->codec_id == AV_CODEC_ID_VP9) {
2443 } else if (track->par->codec_id == AV_CODEC_ID_AV1) {
2445 } else if (track->par->codec_id == AV_CODEC_ID_VC1 && track->vos_len > 0)
2447 else if (track->par->codec_id == AV_CODEC_ID_VP6F ||
2448 track->par->codec_id == AV_CODEC_ID_VP6A) {
2451 } else if (track->par->codec_id == AV_CODEC_ID_R10K) {
2452 if (track->par->codec_tag == MKTAG('R','1','0','k'))
2457 if (track->par->codec_id != AV_CODEC_ID_H264 &&
2458 track->par->codec_id != AV_CODEC_ID_MPEG4 &&
2459 track->par->codec_id != AV_CODEC_ID_DNXHD) {
2460 int field_order = track->par->field_order;
2473 int has_color_info = track->par->color_primaries != AVCOL_PRI_UNSPECIFIED &&
2474 track->par->color_trc != AVCOL_TRC_UNSPECIFIED &&
2475 track->par->color_space != AVCOL_SPC_UNSPECIFIED;
2503 if (track->par->sample_aspect_ratio.den && track->par->sample_aspect_ratio.num) {
2516 if (cuva.cuva_version_map > 0 && track->par->codec_id == AV_CODEC_ID_HEVC) {
2618 if (track->par->extradata_size)
2619 avio_write(pb, track->par->extradata, track->par->extradata_size);
2644 if (track->par->codec_type == AVMEDIA_TYPE_VIDEO)
2646 else if (track->par->codec_type == AVMEDIA_TYPE_AUDIO)
2648 else if (track->par->codec_type == AVMEDIA_TYPE_SUBTITLE)
2650 else if (track->par->codec_tag == MKTAG('r','t','p',' '))
2652 else if (track->par->codec_tag == MKTAG('t','m','c','d'))
2654 else if (track->par->codec_tag == MKTAG('g','p','m','d'))
2657 else if (track->par->codec_type == AVMEDIA_TYPE_TIMEDMETA)
2715 if (track->par->codec_type == AVMEDIA_TYPE_AUDIO && !track->audio_vbr) {
2793 av_assert0(track->par->codec_id == AV_CODEC_ID_OPUS || track->par->codec_id == AV_CODEC_ID_AAC);
2795 if (track->par->codec_id == AV_CODEC_ID_OPUS) {
2873 if ((track->par->codec_type == AVMEDIA_TYPE_VIDEO ||
2874 track->par->codec_id == AV_CODEC_ID_TRUEHD ||
2875 track->par->codec_id == AV_CODEC_ID_MPEGH_3D_AUDIO ||
2877 track->par->codec_tag == MKTAG('r','t','p',' ') ||
2878 track->par->codec_type == AVMEDIA_TYPE_TIMEDMETA) &&
2880 track->par->codec_tag == MKTAG('r','t','p',' ')) &&
2884 if (track->par->codec_type == AVMEDIA_TYPE_VIDEO && track->has_disposable)
2888 if (track->par->codec_type == AVMEDIA_TYPE_VIDEO &&
2900 if (track->par->codec_id == AV_CODEC_ID_OPUS || track->par->codec_id == AV_CODEC_ID_AAC) {
2989 if (track->par->codec_tag == MKTAG('t','m','c','d')) {
2995 } else if (track->par->codec_tag == MKTAG('g','p','m','d')) {
3043 if (track->par->codec_type == AVMEDIA_TYPE_VIDEO) {
3051 } else if (track->par->codec_type == AVMEDIA_TYPE_AUDIO) {
3054 } else if (track->par->codec_type == AVMEDIA_TYPE_SUBTITLE) {
3070 } else if (track->par->codec_tag == MKTAG('r','t','p',' ')) {
3073 } else if (track->par->codec_tag == MKTAG('t','m','c','d')) {
3076 } else if (track->par->codec_tag == MKTAG('g','p','m','d')) {
3080 } else if (track->par->codec_type == AVMEDIA_TYPE_TIMEDMETA) {
3086 av_fourcc2str(track->par->codec_tag));
3307 if (track->par->codec_type == AVMEDIA_TYPE_VIDEO)
3309 else if (track->par->codec_type == AVMEDIA_TYPE_AUDIO)
3311 else if (track->par->codec_type == AVMEDIA_TYPE_SUBTITLE) {
3518 if (track->par->codec_type == AVMEDIA_TYPE_AUDIO)
3532 if (st && (track->par->codec_type == AVMEDIA_TYPE_VIDEO ||
3533 track->par->codec_type == AVMEDIA_TYPE_SUBTITLE)) {
3536 track_width_1616 = track->par->width * 0x10000ULL;
3539 track->par->width * 0x10000LL,
3542 track->height != track->par->height ||
3544 track_width_1616 = track->par->width * 0x10000ULL;
3565 int32_t width = av_rescale(track->par->sample_aspect_ratio.num, track->par->width,
3566 track->par->sample_aspect_ratio.den);
3577 avio_wb32(pb, track->par->height << 16);
3583 avio_wb32(pb, track->par->height << 16);
3588 avio_wb32(pb, track->par->width << 16);
3589 avio_wb32(pb, track->par->height << 16);
3875 if (track->par->codec_type == AVMEDIA_TYPE_VIDEO) {
3899 has_audio |= mov->tracks[i].par->codec_type == AVMEDIA_TYPE_AUDIO;
3900 has_video |= mov->tracks[i].par->codec_type == AVMEDIA_TYPE_VIDEO;
4920 } else if (track->par->codec_type == AVMEDIA_TYPE_AUDIO) {
5051 if (track->par->codec_type == AVMEDIA_TYPE_VIDEO && !is_cover_image(st)) {
5053 } else if (track->par->codec_type == AVMEDIA_TYPE_AUDIO) {
5081 if (track->par->codec_type == AVMEDIA_TYPE_VIDEO) {
5082 if (track->par->codec_id == AV_CODEC_ID_H264) {
5084 int size = track->par->extradata_size;
5085 if (!ff_avc_write_annexb_extradata(track->par->extradata, &ptr,
5088 ptr ? ptr : track->par->extradata,
5093 } else if (track->par->codec_id == AV_CODEC_ID_VC1) {
5095 param_write_hex(pb, "CodecPrivateData", track->par->extradata,
5096 track->par->extradata_size);
5098 param_write_int(pb, "MaxWidth", track->par->width);
5099 param_write_int(pb, "MaxHeight", track->par->height);
5100 param_write_int(pb, "DisplayWidth", track->par->width);
5101 param_write_int(pb, "DisplayHeight", track->par->height);
5103 if (track->par->codec_id == AV_CODEC_ID_AAC) {
5104 switch (track->par->profile)
5115 } else if (track->par->codec_id == AV_CODEC_ID_WMAPRO) {
5118 param_write_hex(pb, "CodecPrivateData", track->par->extradata,
5119 track->par->extradata_size);
5121 track->par->codec_id));
5122 param_write_int(pb, "Channels", track->par->ch_layout.nb_channels);
5123 param_write_int(pb, "SamplingRate", track->par->sample_rate);
5125 param_write_int(pb, "PacketSize", track->par->block_align ?
5126 track->par->block_align : 4);
5209 track->par->codec_type == AVMEDIA_TYPE_VIDEO ?
6291 if (track->par->codec_type == AVMEDIA_TYPE_VIDEO) {
6419 AVCodecParameters *par = trk->par;
6454 if (par->codec_id == AV_CODEC_ID_AMR_NB) {
6468 } else if (par->codec_id == AV_CODEC_ID_ADPCM_MS ||
6469 par->codec_id == AV_CODEC_ID_ADPCM_IMA_WAV) {
6470 samples_in_chunk = trk->par->frame_size;
6482 if (trk->vos_len == 0 && par->extradata_size > 0 &&
6484 (par->codec_id != AV_CODEC_ID_DNXHD)) {
6485 trk->vos_len = par->extradata_size;
6491 memcpy(trk->vos_data, par->extradata, trk->vos_len);
6495 if ((par->codec_id == AV_CODEC_ID_DNXHD ||
6496 par->codec_id == AV_CODEC_ID_H264 ||
6497 par->codec_id == AV_CODEC_ID_HEVC ||
6498 par->codec_id == AV_CODEC_ID_TRUEHD) && !trk->vos_len &&
6511 if (par->codec_id == AV_CODEC_ID_AAC && pkt->size > 2 &&
6521 if (par->codec_id == AV_CODEC_ID_H264 && trk->vos_len > 0 && *(uint8_t *)trk->vos_data != 1 && !TAG_IS_AVCI(trk->tag)) {
6541 } else if (par->codec_id == AV_CODEC_ID_HEVC && trk->vos_len > 6 &&
6561 } else if (par->codec_id == AV_CODEC_ID_AV1) {
6575 } else if (par->codec_id == AV_CODEC_ID_AC3 ||
6576 par->codec_id == AV_CODEC_ID_EAC3) {
6583 } else if (par->codec_id == AV_CODEC_ID_EIA_608) {
6601 if (par->codec_id == AV_CODEC_ID_H264 && par->extradata_size > 4) {
6602 int nal_size_length = (par->extradata[4] & 0x3) + 1;
6604 } else if(par->codec_id == AV_CODEC_ID_HEVC && par->extradata_size > 21) {
6605 int nal_size_length = (par->extradata[21] & 0x3) + 1;
6714 if (par->codec_id == AV_CODEC_ID_VC1) {
6716 } else if (par->codec_id == AV_CODEC_ID_TRUEHD) {
6719 if (mov->mode == MODE_MOV && par->codec_id == AV_CODEC_ID_MPEG2VIDEO &&
6769 AVCodecParameters *par = trk->par;
6790 if (trk->par->codec_id == AV_CODEC_ID_MP4ALS ||
6791 trk->par->codec_id == AV_CODEC_ID_AAC ||
6792 trk->par->codec_id == AV_CODEC_ID_AV1 ||
6793 trk->par->codec_id == AV_CODEC_ID_FLAC) {
6796 if (side && side_size > 0 && (side_size != par->extradata_size || memcmp(side, par->extradata, side_size))) {
6800 av_free(par->extradata);
6801 par->extradata = newextra;
6802 memcpy(par->extradata, side, side_size);
6803 par->extradata_size = side_size;
6829 par->codec_type == AVMEDIA_TYPE_VIDEO &&
6931 if (trk->par->codec_id == AV_CODEC_ID_MOV_TEXT &&
6968 if (trk->mode == MODE_MOV && trk->par->codec_type == AVMEDIA_TYPE_VIDEO) {
6972 int64_t bpc = trk->par->bits_per_coded_sample != 15 ? trk->par->bits_per_coded_sample : 16;
6973 int expected_stride = ((trk->par->width * bpc + 15) >> 4)*2;
6974 reshuffle_ret = ff_reshuffle_raw_rgb(s, &pkt, trk->par, expected_stride);
6979 if (trk->par->format == AV_PIX_FMT_PAL8 && !trk->pal_done) {
6985 } else if (trk->par->codec_id == AV_CODEC_ID_RAWVIDEO &&
6986 (trk->par->format == AV_PIX_FMT_GRAY8 ||
6987 trk->par->format == AV_PIX_FMT_MONOBLACK)) {
7041 track->par = avcodec_parameters_alloc();
7042 if (!track->par)
7044 track->par->codec_type = AVMEDIA_TYPE_SUBTITLE;
7045 ret = ff_alloc_extradata(track->par, sizeof(stub_header));
7048 memcpy(track->par->extradata, stub_header, sizeof(stub_header));
7118 track->par = avcodec_parameters_alloc();
7119 if (!track->par)
7121 track->par->codec_type = AVMEDIA_TYPE_DATA;
7122 track->par->codec_tag = track->tag;
7169 track->par = avcodec_parameters_alloc();
7170 if (!track->par)
7172 track->par->codec_type = AVMEDIA_TYPE_TIMEDMETA;
7173 track->par->codec_id = AV_CODEC_ID_FFMETADATA;
7174 track->par->codec_tag = track_tag;
7242 avcodec_parameters_free(&mov->tracks[mov->chapter_track].par);
7251 av_freep(&track->par);
7570 track->par = st->codecpar;
7618 track->par->codec_id == AV_CODEC_ID_RAWVIDEO &&
7620 enum AVPixelFormat pix_fmt = track->par->format;
7621 if (pix_fmt == AV_PIX_FMT_NONE && track->par->bits_per_coded_sample == 1)
7631 if (track->par->codec_id == AV_CODEC_ID_VP9 && track->mode != MODE_MP4) {
7632 av_log(s, AV_LOG_ERROR, "%s only supported in MP4.\n", avcodec_get_name(track->par->codec_id));
7634 } else if (track->par->codec_id == AV_CODEC_ID_AV1 &&
7636 av_log(s, AV_LOG_ERROR, "%s only supported in MP4 and AVIF.\n", avcodec_get_name(track->par->codec_id));
7638 } else if (track->par->codec_id == AV_CODEC_ID_VP8) {
7673 track->par->codec_id == AV_CODEC_ID_MP3 && track->timescale < 16000) {
7676 i, track->par->sample_rate);
7680 i, track->par->sample_rate);
7683 if (track->par->codec_id == AV_CODEC_ID_FLAC ||
7684 track->par->codec_id == AV_CODEC_ID_TRUEHD ||
7685 track->par->codec_id == AV_CODEC_ID_OPUS) {
7687 av_log(s, AV_LOG_ERROR, "%s only supported in MP4.\n", avcodec_get_name(track->par->codec_id));
7690 if (track->par->codec_id != AV_CODEC_ID_OPUS &&
7695 avcodec_get_name(track->par->codec_id), FF_COMPLIANCE_EXPERIMENTAL);
7702 if (track->par->codec_id == AV_CODEC_ID_TTML) {
7710 ff_is_ttml_stream_paragraph_based(track->par);
7722 track->par->codec_tag == MOV_ISMV_TTML_TAG &&
7755 (track->par->codec_id == AV_CODEC_ID_H264 || track->par->codec_id == AV_CODEC_ID_HEVC),
7806 av_channel_layout_compare(&track->par->ch_layout,
7817 (trackj->par->ch_layout.nb_channels != 1 ||
7818 !av_channel_layout_compare(&trackj->par->ch_layout,
7824 av_channel_layout_compare(&trackj->par->ch_layout,
7826 trackj->par->ch_layout.nb_channels == 1 && track->mono_as_fc >= 0
7831 av_channel_layout_compare(&trackj->par->ch_layout,
8040 AVCodecParameters *par = track->par;
8042 track->vos_len = par->extradata_size;
8047 memcpy(track->vos_data, par->extradata, track->vos_len);
8059 if (trk->par->codec_id == AV_CODEC_ID_MOV_TEXT &&