summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordon.darling <don.darling@24075187-2e39-4e88-bbb8-bc8aa768f540>2010-11-16 20:48:14 +0000
committerdon.darling <don.darling@24075187-2e39-4e88-bbb8-bc8aa768f540>2010-11-16 20:48:14 +0000
commit73227a654421298949f943515f659284ca4c9680 (patch)
treea2560d9df5d89c6b523095f6d9ad6961168c560d
parentf973d3e725526fec8cf88f9699ca461d51ded2ed (diff)
Correct input buffer size calculation
If we know the input buffer is physically contiguous in memory, use its size as the expected size for all input buffers. Otherwise, the codec will be asked the size to expect. This helps with encoding 1080p30 on DM6467T, where the codec reports that the input buffer size should be 1920x1088, where 1920x1080 is usualy what we have and works fine with the encoder. Also, on DM365, the input buffers may have addtional padding so the size of the input buffers is larger than what the codec needs. git-svn-id: https://gstreamer.ti.com/svn/gstreamer_ti/trunk@879 24075187-2e39-4e88-bbb8-bc8aa768f540
-rw-r--r--gstreamer_ti/ti_build/ticodecplugin/src/gsttividenc1.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/gstreamer_ti/ti_build/ticodecplugin/src/gsttividenc1.c b/gstreamer_ti/ti_build/ticodecplugin/src/gsttividenc1.c
index 3dd8ff1..ae94350 100644
--- a/gstreamer_ti/ti_build/ticodecplugin/src/gsttividenc1.c
+++ b/gstreamer_ti/ti_build/ticodecplugin/src/gsttividenc1.c
@@ -887,17 +887,14 @@ static GstFlowReturn gst_tividenc1_chain(GstPad * pad, GstBuffer * buf)
*/
if (videnc1->hEngine == NULL) {
- /* DM365: If we are recieving YUV420PSEMI buffer from upstream
- * then we may need to componsate resizer 32-byte alignment issue.
- * Hence make sure the input buffer will be big enough to hold the
- * 32-byte aligned data from upstream.
+ /* If we know the input buffer is physically contiguous in memory, use
+ * its size as the expected size for all input buffers. Otherwise,
+ * the codec will be asked later on for the size to expect.
*/
- #if defined(Platform_dm365)
- if ((videnc1->device == Cpu_Device_DM365) &&
- (videnc1->colorSpace == ColorSpace_YUV420PSEMI)) {
+ if (videnc1->contiguousInputFrame ||
+ GST_IS_TIDMAIBUFFERTRANSPORT(buf)) {
videnc1->upstreamBufSize = GST_BUFFER_SIZE(buf);
}
- #endif
/* Initialize video encoder */
if (!gst_tividenc1_init_video(videnc1)) {