diff options
author | James Dong <jdong@google.com> | 2011-02-09 14:00:55 -0800 |
---|---|---|
committer | James Dong <jdong@google.com> | 2011-02-09 15:44:32 -0800 |
commit | fcac8fa9421f442f024018628a6042d7a14fbfb0 (patch) | |
tree | 329336bc5a1c31ac94737aa4e25a992a0b87f482 /include | |
parent | 722555f01ace262c2aba9e1ca5d9794ce30c564f (diff) | |
download | frameworks_av-fcac8fa9421f442f024018628a6042d7a14fbfb0.zip frameworks_av-fcac8fa9421f442f024018628a6042d7a14fbfb0.tar.gz frameworks_av-fcac8fa9421f442f024018628a6042d7a14fbfb0.tar.bz2 |
Reduce blocking time in file write
bug - 3418787
Change-Id: I4723662bf46ed07271be8468f84ae5d93cb793fa
Diffstat (limited to 'include')
-rw-r--r-- | include/media/stagefright/MPEG4Writer.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/include/media/stagefright/MPEG4Writer.h b/include/media/stagefright/MPEG4Writer.h index f7618e9..5c5229d 100644 --- a/include/media/stagefright/MPEG4Writer.h +++ b/include/media/stagefright/MPEG4Writer.h @@ -98,6 +98,8 @@ private: List<MediaBuffer *> mSamples; // Sample data // Convenient constructor + Chunk(): mTrack(NULL), mTimeStampUs(0) {} + Chunk(Track *track, int64_t timeUs, List<MediaBuffer *> samples) : mTrack(track), mTimeStampUs(timeUs), mSamples(samples) { } @@ -124,13 +126,14 @@ private: void bufferChunk(const Chunk& chunk); // Write all buffered chunks from all tracks - void writeChunks(); + void writeAllChunks(); - // Write a chunk if there is one - status_t writeOneChunk(); + // Retrieve the proper chunk to write if there is one + // Return true if a chunk is found; otherwise, return false. + bool findChunkToWrite(Chunk *chunk); - // Write the first chunk from the given ChunkInfo. - void writeFirstChunk(ChunkInfo* info); + // Actually write the given chunk to the file. + void writeChunkToFile(Chunk* chunk); // Adjust other track media clock (presumably wall clock) // based on audio track media clock with the drift time. |