summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2012-08-29 13:28:33 +0300
committerMartin Storsjo <martin@martin.st>2012-08-29 15:35:59 +0300
commitd4483f3fd0e024d833082fce3ddbc3a2f3d89b24 (patch)
treea07f1df352ab304cdac9a34d08c4b1613e61fc91 /cmds
parent4b60ac04a878eaf8344b56189509ccd6925855c2 (diff)
downloadframeworks_av-d4483f3fd0e024d833082fce3ddbc3a2f3d89b24.zip
frameworks_av-d4483f3fd0e024d833082fce3ddbc3a2f3d89b24.tar.gz
frameworks_av-d4483f3fd0e024d833082fce3ddbc3a2f3d89b24.tar.bz2
recordvideo: Add an option for choosing software encoders
This is similar to the same option in the 'stagefright' test application. Change-Id: I2a2e5201bd93460df0911ef12865c9030c0183e5
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 3bd1fe2..6de2934 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);