summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
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);