Mercurial > mplayer.hg
comparison libmpdemux/demux_lavf.c @ 35328:5e22bb28e6b7
Print rotation information as identify msg
This patch prints rotation information in metadata of mov files as
identify message with tag "ID_VID_<vid>_ROTATE" to enable frontends
to rotate the video.
author | upsuper |
---|---|
date | Fri, 16 Nov 2012 23:39:27 +0000 |
parents | ceb148e1fe31 |
children | 301d578b9142 |
comparison
equal
deleted
inserted
replaced
35327:891b14e68b02 | 35328:5e22bb28e6b7 |
---|---|
278 AVCodecContext *codec= st->codec; | 278 AVCodecContext *codec= st->codec; |
279 char *stream_type = NULL; | 279 char *stream_type = NULL; |
280 int stream_id; | 280 int stream_id; |
281 AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0); | 281 AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0); |
282 AVDictionaryEntry *title= av_dict_get(st->metadata, "title", NULL, 0); | 282 AVDictionaryEntry *title= av_dict_get(st->metadata, "title", NULL, 0); |
283 AVDictionaryEntry *rot = av_dict_get(st->metadata, "rotate", NULL, 0); | |
283 int g; | 284 int g; |
284 | 285 |
285 switch(codec->codec_type){ | 286 switch(codec->codec_type){ |
286 case AVMEDIA_TYPE_AUDIO:{ | 287 case AVMEDIA_TYPE_AUDIO:{ |
287 WAVEFORMATEX *wf; | 288 WAVEFORMATEX *wf; |
397 sh_video->aspect=codec->width * codec->sample_aspect_ratio.num | 398 sh_video->aspect=codec->width * codec->sample_aspect_ratio.num |
398 / (float)(codec->height * codec->sample_aspect_ratio.den); | 399 / (float)(codec->height * codec->sample_aspect_ratio.den); |
399 sh_video->i_bps=codec->bit_rate/8; | 400 sh_video->i_bps=codec->bit_rate/8; |
400 if (title && title->value) | 401 if (title && title->value) |
401 mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VID_%d_NAME=%s\n", priv->video_streams, title->value); | 402 mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VID_%d_NAME=%s\n", priv->video_streams, title->value); |
403 if (rot && rot->value) | |
404 mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VID_%d_ROTATE=%s\n", priv->video_streams, rot->value); | |
402 mp_msg(MSGT_DEMUX,MSGL_DBG2,"aspect= %d*%d/(%d*%d)\n", | 405 mp_msg(MSGT_DEMUX,MSGL_DBG2,"aspect= %d*%d/(%d*%d)\n", |
403 codec->width, codec->sample_aspect_ratio.num, | 406 codec->width, codec->sample_aspect_ratio.num, |
404 codec->height, codec->sample_aspect_ratio.den); | 407 codec->height, codec->sample_aspect_ratio.den); |
405 | 408 |
406 sh_video->ds= demuxer->video; | 409 sh_video->ds= demuxer->video; |