summaryrefslogtreecommitdiffstats
path: root/cmds/screenrecord
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2014-12-08 13:59:51 -0800
committerMarco Nelissen <marcone@google.com>2014-12-10 00:10:40 +0000
commitc6ac859f5a82ea8642bc6351a45508a15f224f32 (patch)
treefcb36256d059f0f161f7dffade59588e806a1d13 /cmds/screenrecord
parenta1ded198ab2cceb07353a6dd42783e8c8dfdb03f (diff)
downloadframeworks_av-c6ac859f5a82ea8642bc6351a45508a15f224f32.zip
frameworks_av-c6ac859f5a82ea8642bc6351a45508a15f224f32.tar.gz
frameworks_av-c6ac859f5a82ea8642bc6351a45508a15f224f32.tar.bz2
Remove filename based writer constructors
MediaPlayerService can't open files (it needs an already opened file descriptor), so these were just wasting space. Change-Id: I323044a6c1814a7bff952ed71b5c7792df2abf03
Diffstat (limited to 'cmds/screenrecord')
-rw-r--r--cmds/screenrecord/screenrecord.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/cmds/screenrecord/screenrecord.cpp b/cmds/screenrecord/screenrecord.cpp
index 02df1d2..36a7e73 100644
--- a/cmds/screenrecord/screenrecord.cpp
+++ b/cmds/screenrecord/screenrecord.cpp
@@ -23,7 +23,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
#include <sys/wait.h>
+
#include <termios.h>
#include <unistd.h>
@@ -637,7 +640,13 @@ static status_t recordScreen(const char* fileName) {
case FORMAT_MP4: {
// Configure muxer. We have to wait for the CSD blob from the encoder
// before we can start it.
- muxer = new MediaMuxer(fileName, MediaMuxer::OUTPUT_FORMAT_MPEG_4);
+ int fd = open(fileName, O_CREAT | O_LARGEFILE | O_TRUNC | O_RDWR, S_IRUSR | S_IWUSR);
+ if (fd < 0) {
+ fprintf(stderr, "ERROR: couldn't open file\n");
+ abort();
+ }
+ muxer = new MediaMuxer(fd, MediaMuxer::OUTPUT_FORMAT_MPEG_4);
+ close(fd);
if (gRotate) {
muxer->setOrientationHint(90); // TODO: does this do anything?
}