summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2011-07-07 08:30:10 -0700
committerJames Dong <jdong@google.com>2011-07-07 10:30:31 -0700
commitdc7d07e5e402b31068a55c8b055d1a82d61f9ca5 (patch)
treeb1ece2bad901d9e98129b70deda7f144386263a1 /cmds
parent5895e970ae119210773a5184c019178e2516b132 (diff)
downloadframeworks_av-dc7d07e5e402b31068a55c8b055d1a82d61f9ca5.zip
frameworks_av-dc7d07e5e402b31068a55c8b055d1a82d61f9ca5.tar.gz
frameworks_av-dc7d07e5e402b31068a55c8b055d1a82d61f9ca5.tar.bz2
Add support for some custom YUV420 color formats to recordvideo utility
Change-Id: I2f0dfba466efb94b704dca761162d7c7457a43cf
Diffstat (limited to 'cmds')
-rw-r--r--cmds/stagefright/recordvideo.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/cmds/stagefright/recordvideo.cpp b/cmds/stagefright/recordvideo.cpp
index 1264215..c402286 100644
--- a/cmds/stagefright/recordvideo.cpp
+++ b/cmds/stagefright/recordvideo.cpp
@@ -34,7 +34,7 @@ static void usage(const char *me) {
fprintf(stderr, "usage: %s\n", me);
fprintf(stderr, " -h(elp)\n");
fprintf(stderr, " -b bit rate in bits per second (default: 300000)\n");
- fprintf(stderr, " -c YUV420 color format: [0] semi planar or [1] planar (default: 1)\n");
+ fprintf(stderr, " -c YUV420 color format: [0] semi planar or [1] planar or other omx YUV420 color format (default: 1)\n");
fprintf(stderr, " -f frame rate in frames per second (default: 30)\n");
fprintf(stderr, " -i I frame interval in seconds (default: 1)\n");
fprintf(stderr, " -n number of frames to be recorded (default: 300)\n");
@@ -59,11 +59,6 @@ public:
mSize((width * height * 3) / 2) {
mGroup.add_buffer(new MediaBuffer(mSize));
-
- // Check the color format to make sure
- // that the buffer size mSize it set correctly above.
- CHECK(colorFormat == OMX_COLOR_FormatYUV420SemiPlanar ||
- colorFormat == OMX_COLOR_FormatYUV420Planar);
}
virtual sp<MetaData> getFormat() {
@@ -144,9 +139,13 @@ static int translateColorToOmxEnumValue(int color) {
case kYUV420P:
return OMX_COLOR_FormatYUV420Planar;
default:
- fprintf(stderr, "Unsupported color: %d\n", color);
- return -1;
+ fprintf(stderr, "Custom OMX color format: %d\n", color);
+ if (color == OMX_TI_COLOR_FormatYUV420PackedSemiPlanar ||
+ color == OMX_QCOM_COLOR_FormatYVU420SemiPlanar) {
+ return color;
+ }
}
+ return -1;
}
int main(int argc, char **argv) {