diff options
author | Marco Nelissen <marcone@google.com> | 2014-12-08 13:59:51 -0800 |
---|---|---|
committer | Marco Nelissen <marcone@google.com> | 2014-12-10 00:10:40 +0000 |
commit | c6ac859f5a82ea8642bc6351a45508a15f224f32 (patch) | |
tree | fcb36256d059f0f161f7dffade59588e806a1d13 /cmds/stagefright/muxer.cpp | |
parent | a1ded198ab2cceb07353a6dd42783e8c8dfdb03f (diff) | |
download | frameworks_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/stagefright/muxer.cpp')
-rw-r--r-- | cmds/stagefright/muxer.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/cmds/stagefright/muxer.cpp b/cmds/stagefright/muxer.cpp index f4a33e8..461b56c 100644 --- a/cmds/stagefright/muxer.cpp +++ b/cmds/stagefright/muxer.cpp @@ -17,6 +17,9 @@ //#define LOG_NDEBUG 0 #define LOG_TAG "muxer" #include <inttypes.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> #include <utils/Log.h> #include <binder/ProcessState.h> @@ -72,8 +75,15 @@ static int muxing( ALOGV("input file %s, output file %s", path, outputFileName); ALOGV("useAudio %d, useVideo %d", useAudio, useVideo); - sp<MediaMuxer> muxer = new MediaMuxer(outputFileName, + int fd = open(outputFileName, O_CREAT | O_LARGEFILE | O_TRUNC | O_RDWR, S_IRUSR | S_IWUSR); + + if (fd < 0) { + ALOGE("couldn't open file"); + return fd; + } + sp<MediaMuxer> muxer = new MediaMuxer(fd, MediaMuxer::OUTPUT_FORMAT_MPEG_4); + close(fd); size_t trackCount = extractor->countTracks(); // Map the extractor's track index to the muxer's track index. |