[FFmpeg-devel] [PATCH] List supported video size and rate abbreviations

Michael Niedermayer michaelni
Fri Jun 1 21:16:25 CEST 2007


Hi

On Fri, Jun 01, 2007 at 06:13:28PM +0200, Stefano Sabatini wrote:
[...]

> Index: ffmpeg.c
> ===================================================================
> --- ffmpeg.c	(revision 9165)
> +++ ffmpeg.c	(working copy)
> @@ -2065,12 +2065,27 @@
>      av_log_level = atoi(arg);
>  }
>  
> +static void list_video_rate_abvs(void)

what is abvs? if you mean abbreviation thats abbr (try google with both)



> +{
> +    int i;
> +    char video_rate_abv_str[128];
> +    for (i=-1; i < video_size_rate_abv_nb; i++) {
> +        if (avcodec_video_rate_abv_string (video_rate_abv_str, sizeof(video_rate_abv_str), i) == 0)
> +            fprintf(stdout, "%s\n", video_rate_abv_str);

fprintf(stdout,  == printf(


> +    }
> +}
> +
>  static void opt_frame_rate(const char *arg)
>  {
> +    if (strcmp (arg, "list") == 0) {

if(!strcmp(arg, "list"))


> +        list_video_rate_abvs();
> +        exit(0);
> +    } else {
>      if (parse_frame_rate(&frame_rate, &frame_rate_base, arg) < 0) {

} else if ( ... 


[...]
> Index: libavformat/avformat.h
> ===================================================================
> --- libavformat/avformat.h	(revision 9165)
> +++ libavformat/avformat.h	(working copy)
> @@ -883,6 +883,46 @@
>  
>  int match_ext(const char *filename, const char *extensions);
>  
> +
> +/**
> + * Number of supported video size and rate abbreviations supported.
> + */
> +extern int const video_size_rate_abv_nb;

would need a av_ or avcodec_ prefix
and iam not completely sure if i like this implementation, somehow i
dont ...



[...]

> +int avcodec_video_rate_abv_string (char *buf, int buf_size, int video_rate_abv)
> +{
> +    AbvEntry info= frame_abvs[video_rate_abv];
> +
> +    /* print header */
> +    if (video_rate_abv < 0) {
> +        snprintf (buf, buf_size,
> +                  "name      "  " frame_rate" " frame_rate_base"
> +            );
> +    } else if (video_rate_abv < video_size_rate_abv_nb && info.frame_rate != 0) {

} else if (video_rate_abv < video_size_rate_abv_nb && info.frame_rate) {


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070601/54d834e7/attachment.pgp>



More information about the ffmpeg-devel mailing list