diff options
author | Jean-Baptiste Queru <jbq@google.com> | 2012-08-29 10:58:21 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-08-29 10:58:21 -0700 |
commit | b7b8de8878a32cd62916b29cf2cbf4f7437adbea (patch) | |
tree | 408f84d244d56ccf70c58d87da5416d1ae31fbd6 /cmds | |
parent | ac4187569c7011c2dcfb9ed1ad658b7ad8cba046 (diff) | |
parent | 0924dd88790ba9cda0d5a86df7d68b7446470fc7 (diff) | |
download | frameworks_av-b7b8de8878a32cd62916b29cf2cbf4f7437adbea.zip frameworks_av-b7b8de8878a32cd62916b29cf2cbf4f7437adbea.tar.gz frameworks_av-b7b8de8878a32cd62916b29cf2cbf4f7437adbea.tar.bz2 |
am 0924dd88: am 2aa37a7d: Merge "recordvideo: Add an option for choosing software encoders"
* commit '0924dd88790ba9cda0d5a86df7d68b7446470fc7':
recordvideo: Add an option for choosing software encoders
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/stagefright/recordvideo.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/cmds/stagefright/recordvideo.cpp b/cmds/stagefright/recordvideo.cpp index 29ed775..e02f111 100644 --- a/cmds/stagefright/recordvideo.cpp +++ b/cmds/stagefright/recordvideo.cpp @@ -43,6 +43,7 @@ static void usage(const char *me) { fprintf(stderr, " -l encoder level. see omx il header (default: encoder specific)\n"); fprintf(stderr, " -p encoder profile. see omx il header (default: encoder specific)\n"); fprintf(stderr, " -v video codec: [0] AVC [1] M4V [2] H263 (default: 0)\n"); + fprintf(stderr, " -s(oftware) prefer software codec\n"); fprintf(stderr, "The output file is /sdcard/output.mp4\n"); exit(1); } @@ -162,10 +163,11 @@ int main(int argc, char **argv) { int profile = -1; // Encoder specific default int codec = 0; const char *fileName = "/sdcard/output.mp4"; + bool preferSoftwareCodec = false; android::ProcessState::self()->startThreadPool(); int res; - while ((res = getopt(argc, argv, "b:c:f:i:n:w:t:l:p:v:h")) >= 0) { + while ((res = getopt(argc, argv, "b:c:f:i:n:w:t:l:p:v:hs")) >= 0) { switch (res) { case 'b': { @@ -233,6 +235,12 @@ int main(int argc, char **argv) { break; } + case 's': + { + preferSoftwareCodec = true; + break; + } + case 'h': default: { @@ -278,7 +286,8 @@ int main(int argc, char **argv) { sp<MediaSource> encoder = OMXCodec::Create( - client.interface(), enc_meta, true /* createEncoder */, source); + client.interface(), enc_meta, true /* createEncoder */, source, + 0, preferSoftwareCodec ? OMXCodec::kPreferSoftwareCodecs : 0); sp<MPEG4Writer> writer = new MPEG4Writer(fileName); writer->addSource(encoder); |