android h264 hardware encoding
Sebastian Dröge
slomo at coaxion.net
Sun Oct 20 08:46:19 CEST 2013
On So, 2013-10-20 at 10:12 +0800, cee1 wrote:
> 2013/10/19 Sebastian Dröge <slomo at coaxion.net>:
> > On Fr, 2013-10-18 at 05:55 -0700, yoyosuper8 wrote:
> >> Ok, so I downloaded the mcplayer example and changed the pipeline to use the
> >> hw encoder on the samsung galaxy s2 phone and I get the following error:
> >>
> >> ACodec [OMX.TI.DUCATI1.VIDEO.H264E] does not support color format 21
> >> ACoder [OMX.TI.DUCATI1.VIDEO.H264E] configureCodec returning error
> >> -2147483648
> >> MediaCodec Codec reported an error. (omx error 0x80001001, internalError
> >> -2147483648
> >>
> >> The same error showed up on my application when I changed the pipeline to
> >> the following (which is the same as the pipeline in mcplayer, but with my
> >> own hw encoder):
> >>
> >> gst_rtsp_media_factory_set_launch (factory,
> >> "( videotestsrc is-live=true do-timestamp=true ! capsfilter
> >> caps=\"video/x-raw,
> >> width=640,height=480,framerate=8/1\" ! amcvidenc-omxtiducati1videoh264e
> >> bitrate=1024
> >> i-frame-interval=8 ! queue ! capssetter
> >> caps=\"video/x-h264,profile=baseline\" ! h264parse !
> >> rtph264pay name=pay0 pt=96 )");
> >>
> >> Could it be a problem in the androidmedic code?
> >
> > It is, yes. It tries to configure color format 21, but that is not
> > supported by the hardware. Instead it would need to query the support
> > color formats and properly negotiate them with the upstream elements
> > (i.e. cause videoconvert to convert to something supported in the worst
> > case).
> I think the current code has already handle this:
> """
> allowed_caps = gst_pad_get_allowed_caps (GST_VIDEO_ENCODER_SRC_PAD (encoder));
> if (!allowed_caps) {
> GST_DEBUG_OBJECT (self, "... but no peer, using template caps");
> /* we need to copy because get_allowed_caps returns a ref, and
> * get_pad_template_caps doesn't */
> allowed_caps =
> gst_caps_copy (gst_pad_get_pad_template_caps (GST_VIDEO_ENCODER_SRC_PAD
> (encoder)));
> }
How are the template caps of the sinkpad built currently? By iterating
over the colorformats supported by the encoder, right? Then it should
indeed by fine and the error should be looked for on a) the code that
generates the sinkpad template caps, b) in the code from Samsung.
The code you pasted is only for negotiating a correct format with
downstream, e.g. to negotiate the h264 profile and level.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 966 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20131020/6c51bf8f/attachment.pgp>
More information about the gstreamer-devel
mailing list