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 | f6a2bff0c9f65b318bbe2236d19423dc013123b9 (patch) | |
tree | f4399f79fc80f7f8f0d4b653a2d87c5fb9620701 /include/media | |
parent | 455644ee1cad8554aa3c2a00e3e639bca032c981 (diff) | |
download | frameworks_base-f6a2bff0c9f65b318bbe2236d19423dc013123b9.zip frameworks_base-f6a2bff0c9f65b318bbe2236d19423dc013123b9.tar.gz frameworks_base-f6a2bff0c9f65b318bbe2236d19423dc013123b9.tar.bz2 |
Reduce blocking time in file write
bug - 3418787
Change-Id: I4723662bf46ed07271be8468f84ae5d93cb793fa
Diffstat (limited to 'include/media')
-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. |