diff options
author | Deva Ramasubramanian <dramasub@codeaurora.org> | 2015-08-25 16:42:53 -0700 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2015-10-06 03:25:05 -0600 |
commit | f67967d87241de2a7bef16bc00407925fd2104d3 (patch) | |
tree | 9cc33357e5cbadf74d9ee84ecd81df0e564688c8 /media/libstagefright/StagefrightMetadataRetriever.cpp | |
parent | b2d62dabe04ed86315e7cfde724e350224d938ce (diff) | |
download | frameworks_av-f67967d87241de2a7bef16bc00407925fd2104d3.zip frameworks_av-f67967d87241de2a7bef16bc00407925fd2104d3.tar.gz frameworks_av-f67967d87241de2a7bef16bc00407925fd2104d3.tar.bz2 |
libstagefright: Use stride/slice-height instead of w/h for buffer dims
The stride and slice are better suited as dimension parameters to
ColorConvertor, as it considers the width to be be "line length".
This fixes thumbnail generation issues for clips with strange resolutions,
where the stride != width.
Change-Id: I84143956a113cf1976202bd9c4ddac988278a5c0
Diffstat (limited to 'media/libstagefright/StagefrightMetadataRetriever.cpp')
-rw-r--r-- | media/libstagefright/StagefrightMetadataRetriever.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/media/libstagefright/StagefrightMetadataRetriever.cpp b/media/libstagefright/StagefrightMetadataRetriever.cpp index 7d5f27f..ccf4587 100644 --- a/media/libstagefright/StagefrightMetadataRetriever.cpp +++ b/media/libstagefright/StagefrightMetadataRetriever.cpp @@ -354,9 +354,11 @@ static VideoFrame *extractVideoFrame( } } - int32_t width, height; + int32_t width, height, stride, slice_height; CHECK(outputFormat->findInt32("width", &width)); CHECK(outputFormat->findInt32("height", &height)); + CHECK(outputFormat->findInt32("stride", &stride)); + CHECK(outputFormat->findInt32("slice-height", &slice_height)); int32_t crop_left, crop_top, crop_right, crop_bottom; if (!outputFormat->findRect("crop", &crop_left, &crop_top, &crop_right, &crop_bottom)) { @@ -394,7 +396,7 @@ static VideoFrame *extractVideoFrame( if (converter.isValid()) { err = converter.convert( (const uint8_t *)videoFrameBuffer->data(), - width, height, + stride, slice_height, crop_left, crop_top, crop_right, crop_bottom, frame->mData, frame->mWidth, |