[Bug 705129] androidmedia: add support for video encoding

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Fri Nov 15 17:29:19 PST 2013


https://bugzilla.gnome.org/show_bug.cgi?id=705129
  GStreamer | gst-plugins-bad | git

--- Comment #12 from cee1 <fykcee1 at gmail.com> 2013-11-16 01:28:58 UTC ---
Three more patches for making amcvideoenc work better:
1. androidmedia: new prototype for color_format/video_format conversion
(https://github.com/cee1/gst-plugins-bad/commit/98c994f953dd8faa658122fbabbcf034a367b28d)
2. androidmedia: add gst_amc_color_format_copy
(https://github.com/cee1/gst-plugins-bad/commit/ff77dcbb01a7af0a2a3c1d940abc84b2721afedd)
3.androidmedia: add a COLOR_FormatYCbYCr to GST_VIDEO_FORMAT_YUY2 mapping.
(https://github.com/cee1/gst-plugins-bad/commit/149ea45cc8d6c459f7dd59cd72eb59e7a237fe15)

There are two concepts of color_format: the reported color_format and the
"real" color_format
== The reported color_format ==
That's the supporting color_format reported by the codec. Some considerations
for  it:
a) codec reports supporting color_format CA, then it may need to map CA to
gstvideoformat VA in amcvideodec/enc, and then map back. VA may be mapped to
CA' in current code, e.g.
COLOR_QCOM_FormatYUV420SemiPlanar -> GST_VIDEO_FORMAT_NV12 ->
COLOR_FormatYUV420SemiPlanar
Which causes amc_codec_configure failed with "not supported color format"

b)  codec may report wrong color_format CA, which is actually color_format CB,
so we have to map CA to gstvideoformat VB and mapped back to CA.

a) and b) are handled in patch 1: "androidmedia: new prototype for
color_format/video_format conversion"

== The "real" color_format ==
That's used in *_fill_buffer in amcvideodec, *_fill_buffer will copy a
"sparse-layouted" frame of color_format CA to a "densely-layouted" frame of
elated gstvideoformat VA.

Patch 2: "androidmedia: add gst_amc_color_format_copy" introduces a
GstAmcColorFormatInfo to describe a sparse layout, a new function
gst_amc_color_format_copy to copy data from a "sparse-layouted" frame to a
"densely-layouted" frame and reverse.

For amcvideoenc, it needs to evaluate the size of a "sparse-layouted"
frame(color_format_info.frame_size), which is used to determine whether go
through the fast path in *_fill_buffer.

The color_format_info.frame_size is calculated in
gst_amc_color_format_info_set. Note, I'm not sure the frame_size calculations
for COLOR_TI_FormatYUV420PackedSemiPlanar and
COLOR_QCOM_FormatYUV420PackedSemiPlanar64x32Tile2m8ka are correct, please
review.

Overall, patch 2 moves lots of codes in *_fill_buffer to
gst_amc_color_format_copy, make the logic shared between amcvideodec and
amcvideoenc.

BTW, Patch 1 and patch 2 move all current hacks to
gst_amc_color_format_to_video_format /gst_amc_video_format_to_color_format
/gst_amc_color_format_info_set in gstamc.c


A full list of the patches can be found in my github's master branch:
https://github.com/cee1/gst-plugins-bad/commits/master

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list