[FFmpeg-devel] [PATCH] omx: Add support for specifying H.264 profile [v2]

Michael Niedermayer michael at niedermayer.cc
Tue Feb 7 02:23:32 EET 2017


On Tue, Feb 07, 2017 at 06:28:11AM +0900, Takayuki 'January June' Suwa wrote:
> This adds "-profile[:v] profile_name"-style option IOW.
> 
> Thanks for reviewing my poor ugly patch, Mark...  and I get back to
> an original purpose - forcing OMX to use baseline profile.
> (eg. RasPiCam-to-Ustream webcasting w/o additional xcoding)
> ---
>  libavcodec/omx.c | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/libavcodec/omx.c b/libavcodec/omx.c
> index 16df50e..faa70ae 100644
> --- a/libavcodec/omx.c
> +++ b/libavcodec/omx.c
> @@ -226,6 +226,7 @@ typedef struct OMXCodecContext {
>      int output_buf_size;
> 
>      int input_zerocopy;
> +    int profile;
>  } OMXCodecContext;
> 
>  static void append_buffer(pthread_mutex_t *mutex, pthread_cond_t *cond,
> @@ -523,6 +524,20 @@ static av_cold int
> omx_component_init(AVCodecContext *avctx, const char *role)
>          CHECK(err);
>          avc.nBFrames = 0;
>          avc.nPFrames = avctx->gop_size - 1;
> +        switch (s->profile) {
> +        case FF_PROFILE_H264_BASELINE:
> +            avctx->profile = s->profile;
> +            avc.eProfile = OMX_VIDEO_AVCProfileBaseline;
> +            break;
> +        case FF_PROFILE_H264_MAIN:
> +            avctx->profile = s->profile;
> +            avc.eProfile = OMX_VIDEO_AVCProfileMain;
> +            break;
> +        case FF_PROFILE_H264_HIGH:
> +            avctx->profile = s->profile;
> +            avc.eProfile = OMX_VIDEO_AVCProfileHigh;
> +            break;
> +        }
>          err = OMX_SetParameter(s->handle, OMX_IndexParamVideoAvc, &avc);
>          CHECK(err);
>      }
> @@ -884,6 +899,10 @@ static const AVOption options[] = {
>      { "omx_libname", "OpenMAX library name", OFFSET(libname),
> AV_OPT_TYPE_STRING, { 0 }, 0, 0, VDE },
>      { "omx_libprefix", "OpenMAX library prefix", OFFSET(libprefix),
> AV_OPT_TYPE_STRING, { 0 }, 0, 0, VDE },

There are some extraneous newlines in the patch which cause git am
to fail
"error: corrupt patch at line 18"

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170207/8e5b72e5/attachment.sig>


More information about the ffmpeg-devel mailing list