summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2012-08-29 09:07:26 -0700
committerandroid code review <noreply-gerritcodereview@google.com>2012-08-29 09:07:27 -0700
commit2aa37a7d15f5e2246b8996d2600269684904c581 (patch)
tree0cf9b71a4e3cdde4dff5293d17417936d289f757 /cmds
parent9ce74352d23d833f9627b7be58be964206e6ff6d (diff)
parentd4483f3fd0e024d833082fce3ddbc3a2f3d89b24 (diff)
downloadframeworks_av-2aa37a7d15f5e2246b8996d2600269684904c581.zip
frameworks_av-2aa37a7d15f5e2246b8996d2600269684904c581.tar.gz
frameworks_av-2aa37a7d15f5e2246b8996d2600269684904c581.tar.bz2
Merge "recordvideo: Add an option for choosing software encoders"
Diffstat (limited to 'cmds')
-rw-r--r--cmds/stagefright/recordvideo.cpp13
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);