summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/MPEG4Writer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* libstagefright: compile errorsMark Salyzyn2014-10-081-1/+6
| | | | Change-Id: I752d7d73f9c4939160a1ccaefc44ce1f8ffd9982
* libstagefright: 64-bit compile warningsMark Salyzyn2014-06-261-29/+29
| | | | Change-Id: I3d1146714fa23be3d4e696599b6f70cac1f9d28b
* MPEG4Writer: replace timestamp asserts in threadEntry w err return.Robert Shih2014-02-241-10/+42
| | | | | Bug: 12117267 Change-Id: I13630221c1a8f2e70711f2488659b977db3be281
* Merge "Try not to have sample durations vary too much"Marco Nelissen2014-02-141-0/+16
|\
| * Try not to have sample durations vary too muchMarco Nelissen2014-02-131-0/+16
| | | | | | | | Change-Id: Ibbd0f0a253cc74e241236b7a30d1c931e18af753
* | Merge "Increased recorded MP4 max file size to 4GB (more precisely 2^32-1 ↵Rachad2014-02-121-3/+5
|\ \ | | | | | | | | | bytes -- FAT32 max file size)"
| * | Increased recorded MP4 max file size to 4GBRachad2014-02-101-3/+5
| | | | | | | | | | | | | | | | | | | | | (more precisely 2^32-1 bytes -- FAT32 max file size) bug: 11039801 Change-Id: I6169f798c59d123d02d5fd7afa3b9e645ebdb598
* | | warnings be gone.Andreas Huber2014-02-111-1/+1
| |/ |/| | | | | Change-Id: Ie3bae3f037730e316d7fca12e7a3527973f752ef
* | resolved conflicts for merge of 566be7c3 to masterNarayan Kamath2014-02-111-9/+10
|\ \ | |/ |/| | | Change-Id: I7b1cc71057b2bd4f771e7bcf508a8c3abd6017ce
| * Make frameworks/av 64-bit compatibleKévin PETIT2014-02-111-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | Contains the necessary changes to make frameworks/av build and work on a 64-bit machine. Signed-off-by: Craig Barber <craig.barber@arm.com> Signed-off-by: Kévin PETIT <kevin.petit@arm.com> Signed-off-by: Ashok Bhat <ashok.bhat@arm.com> Signed-off-by: Marcus Oakland <marcus.oakland@arm.com> Change-Id: I725feaae50ed8eee25ca2c947cf15aee1f395c43
| * MediaMuxer prefer not to use the MPEG4Writer in real time recording mode.ztenghui2013-04-151-16/+27
| | | | | | | | | | | | | | | | By default, MPEG4Write will keep running in real time recording mode. bug:8598944 Change-Id: Idf7fbd4e0feb7763660a74279ba8817b79098aaf
| * Make limitations of MPEG4Writer explicitJames Dong2013-03-141-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | o No more than 2 tracks will be supported o No more than one video and/or one audio tracks will be supported o Only take video and/or audio track (for instance, no text tracks) o If there is no track before start() is called, bail out. At the same time, make sure the errors from addSource() report to addTrack(), not to start(). Bug: 7991013 Change-Id: I1ca35aaeb75b5448d75ed2c6c10dd12ecea720ab
| * am 801726ef: Merge "MPEG4Writer: Write a zero-length compressor string"Andreas Huber2013-02-271-1/+2
| |\ | | | | | | | | | | | | * commit '801726efb2dcc6ea19e9f55c7c43fe41f0c6643e': MPEG4Writer: Write a zero-length compressor string
| | * MPEG4Writer: Write a zero-length compressor stringMartin Storsjo2013-01-311-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first byte is the number of bytes in the string to display, the rest is the actual string (see ISO/IEC 14496-12:2008 page 29, compressorname in VisualSampleEntry) to display. Currently, all 31 space characters are displayed in certain players (such as Apple QuickTime Player) instead of the plain codec name (e.g. "H.264"). By writing the string length properly, the actual content of the remaining 31 bytes is ignored instead of displayed. Change-Id: I7f93a8966d74a4e86abc46c3dcb70f71780d9cd6
| * | Fix memory leakage from MPEG4Writer.James Dong2012-12-181-18/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o The in-memory cache, mMoovBoxBuffer, holding the content for Moov box may not be freed. o Added comment describing how the in-memory cache works o Moved the memory release to a single place to make the code more robust o Avoided allocating the in-memory cache if the file is not intended to be streamable o related-to-bug: 7664029 Change-Id: If04fc6b12daeaaa86710dfb4b4b9c175da6421df
| * | Turn off executable bit on ordinary filesGlenn Kasten2012-11-021-0/+0
| |/ | | | | | | Change-Id: I0abea25b58fb1d03975bed9cca40f826fcd4c5e4
* | Change StagefrightRecorder to use MediaCodecChong Zhang2014-02-051-10/+5
| | | | | | | | | | Bug: 12305192 Change-Id: I72d7cb571be5bd348b58ad650f3269d24c15d350
* | MPEG4Writer: use "mp42" as major/minor brand in ftyp box.Robert Shih2014-01-301-3/+6
| | | | | | | | | | Bug: 12783430 Change-Id: I7c8029de1db21fcac0ce3e4505661189535c45f1
* | MediaMuxer prefer not to use the MPEG4Writer in real time recording mode.ztenghui2013-04-151-16/+27
| | | | | | | | | | | | | | | | By default, MPEG4Write will keep running in real time recording mode. bug:8598944 Change-Id: Idf7fbd4e0feb7763660a74279ba8817b79098aaf
* | Make limitations of MPEG4Writer explicitJames Dong2013-03-141-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | o No more than 2 tracks will be supported o No more than one video and/or one audio tracks will be supported o Only take video and/or audio track (for instance, no text tracks) o If there is no track before start() is called, bail out. At the same time, make sure the errors from addSource() report to addTrack(), not to start(). Bug: 7991013 Change-Id: I1ca35aaeb75b5448d75ed2c6c10dd12ecea720ab
* | am 801726ef: Merge "MPEG4Writer: Write a zero-length compressor string"Andreas Huber2013-02-271-1/+2
|\ \ | | | | | | | | | | | | * commit '801726efb2dcc6ea19e9f55c7c43fe41f0c6643e': MPEG4Writer: Write a zero-length compressor string
| * | MPEG4Writer: Write a zero-length compressor stringMartin Storsjo2013-01-311-1/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | The first byte is the number of bytes in the string to display, the rest is the actual string (see ISO/IEC 14496-12:2008 page 29, compressorname in VisualSampleEntry) to display. Currently, all 31 space characters are displayed in certain players (such as Apple QuickTime Player) instead of the plain codec name (e.g. "H.264"). By writing the string length properly, the actual content of the remaining 31 bytes is ignored instead of displayed. Change-Id: I7f93a8966d74a4e86abc46c3dcb70f71780d9cd6
* | Fix memory leakage from MPEG4Writer.James Dong2012-12-181-18/+72
| | | | | | | | | | | | | | | | | | | | | | o The in-memory cache, mMoovBoxBuffer, holding the content for Moov box may not be freed. o Added comment describing how the in-memory cache works o Moved the memory release to a single place to make the code more robust o Avoided allocating the in-memory cache if the file is not intended to be streamable o related-to-bug: 7664029 Change-Id: If04fc6b12daeaaa86710dfb4b4b9c175da6421df
* | Turn off executable bit on ordinary filesGlenn Kasten2012-11-021-0/+0
|/ | | | Change-Id: I0abea25b58fb1d03975bed9cca40f826fcd4c5e4
* am 51af4af2: am e28df5b9: Merge "Store correct time stamps in recorded mp4 ↵Jean-Baptiste Queru2012-08-081-6/+15
|\ | | | | | | | | | | | | files" * commit '51af4af2414cdaaf0185b971a41fc0b4f8c0b7e4': Store correct time stamps in recorded mp4 files
| * Store correct time stamps in recorded mp4 filesJohannes Carlsson2012-07-301-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the specification (ISO_IEC_14496-12_2008 page 17, 19 and 21) the time is "in seconds since midnight, Jan. 1, 1904, in UTC time" which is not the same as Unix epoch time. This is already correctly handled in MPEG4Extractor.cpp when reading files. The specification also supports 64 bit timestamps which would make it a bit more future proof, but unfortunately it seems like support for this in players are poor (tested both Windows media player and Quicktime player). Change-Id: I102d728f098b8b0a21013956f017b0c4f2d69112
* | Make sure that the trackId starts from 1James Dong2012-08-071-2/+2
| | | | | | | | | | | | | | o this patch avoids sending incorrect track events to applications because track events contain the trackId Change-Id: I1cf054da8ab413d31a5b7fe8ed729486d1475c46
* | Should really compare the pos to the total number of values in get() and ↵James Dong2012-07-301-2/+2
| | | | | | | | | | | | | | | | set() methods in ListTableEntries class o related-to-bug: 6435176 Change-Id: Ib6f6e598304e7c9becfa6cb3fc925c55b2df2682
* | Refactoring how the box table entries are stored in MPEG4WriterJames Dong2012-07-301-193/+228
| | | | | | | | | | | | | | | | | | o Helps drastically reduce the time writing all the box table entries for long duration video recording sessions. Experiments showed that the time is reduced from multiple seconds to less than one second for around 2.5 hours of video recording. Change-Id: I6a696823e2938b76fcf2c73605f51bf5e5c2d749 related-to-bug: 6435176
* | Added number of encoded frames and duration to the MPEG4Writer::Track::dumpJames Dong2012-07-191-1/+5
| | | | | | | | | | | | o also removed unused varialble mMaxTimeStampUs Change-Id: I61a47e1ec8ee96a25df668637c4d4661188a1a8c
* | When a request max file size is relatively small, don't store moov header at theJames Dong2012-07-191-7/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | beginning of a recorded mp4 file. Trying to put the 'moov' box at the beginning of an mp4 file requires to reserve some estimated space for 'moov'. The estimate can be larger or smaller than the actual 'moov' size. When the estimate is larger, we could meet the file size limit, although some space is wasted; but when the estimate is smaller than the actual 'moov' size, we not only waste the reserved space but also have to use extra space to write 'moov' space at the end of the file. In this case, often the requested file size limit could be exceeded by a large margin. This patch avoids putting the 'moov' box at the beginning when a file size limit is explicitly requested. Change-Id: I838443d08b5589f33f3c486c662195600e3edb9b related-to-bug: 6697505
* | Add mode when open(O_CREAT) is used.Nick Kralevich2012-06-261-1/+1
|/ | | | | | | | | | When creating a new file using open(..., O_CREAT), it is an error to fail to specify a creation mode. If a mode is not specified, a random stack provided value is used as the "mode". This will become a compile error in a future Android change. Change-Id: I36a3d67d294a915c1f79632a1b0ba45edd1214b1
* Fix an error caused by sample size value by orderJames Dong2012-05-241-2/+2
| | | | | | | | | The sample size was saved in the array in network order, but it was treated as host order when writeInt32() is called. Calling write(void *, int, int) resolves the issue. related-to-bug: 6555366 Change-Id: If7ef99911ad65108c61b533673ac4d4cd580a370
* Speed up stsz box write in MPEG4WriterJames Dong2012-05-151-10/+38
| | | | | | | | With this patch, the write time for 30+ minutes recording session is reduced from 10+ seconds down to around 2-3 seconds. related-to-bug: 6435176 Change-Id: I83b705cea42d8de798e7032c770c5c7b033e267e
* Finish up B frame support in MPEG4WriterJames Dong2012-02-091-36/+50
| | | | | | | | | | o optimize to reduce the size of the size of the ctts box o change the type for the time offset field in ctts table entry from int32_t to uint32_t according to the mp4 file spec o also moved away from MediaDebug and used ADebug instead. o related-to-bug: 4232183 Change-Id: I19364303728da64359c63169eec7487508c1d0f8
* Enable B frame support in MPEG4WriterJames Dong2012-02-071-68/+79
| | | | | | | | | | | | | | | | This patch allows us to automatically detect whether ctts box is needed in MPEG4Writer. MPEG4Writer uses ctts version 0 (non-negative offset value) store the composition time offset on a needed basis. Currently, the size of the ctts box is not optimized. Optimization will be addressed in a subsequent patch. o also changed the private method retrieveDecodingTime(bool) in OMXCodec to getDecodingTime() o related-to-bug: 4232183 Change-Id: Ic6dc7b25ecd258c2506ca4b9c25156e922456e51
* Don't call virtual functions in destructors for the writer classesJames Dong2012-02-021-2/+2
| | | | | | | Have not found any concrete bugs related to these calls yet, but we should avoid calling virtual functions in destructors, regardless. Change-Id: I2d47b79d3fb2d29f418619bee83aa147d232a5d4
* Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGESteve Block2012-01-081-22/+22
| | | | | | | See https://android-git.corp.google.com/g/#/c/157220 Bug: 5449033 Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
* Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGESteve Block2012-01-061-2/+2
| | | | | | | See https://android-git.corp.google.com/g/157065 Bug: 5449033 Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69
* Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGESteve Block2012-01-041-7/+7
| | | | | | | See https://android-git.corp.google.com/g/156801 Bug: 5449033 Change-Id: Ib08fe86d23db91ee153e9f91a99a35c42b9208ea
* Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGESteve Block2012-01-031-7/+7
| | | | | | | See https://android-git.corp.google.com/g/156016 Bug: 5449033 Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
* Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF) DO NOT MERGESteve Block2011-10-261-29/+29
| | | | | | | See https://android-git.corp.google.com/g/#/c/143865 Bug: 5449033 Change-Id: I0122812ed6ff6f5b59fe4a43ab8bff0577adde0a
* Fixing small syntax error in MPEG4 loggingPannag Sanketi2011-08-261-2/+2
| | | | | | | Found that the build was breaking when the logging was enabled in MPEG4Writer. Fixed. Change-Id: I62c5e6d16b2ecf5644c8d46b9bbcca68a797b223
* Fix initial 0 duration video sample in the recorded videosJames Dong2011-08-091-8/+12
| | | | | | | o Patch suggested by pmehendale@nvidia.com Change-Id: Ibf516ba83b721b0d0ab55bb7637fe9b7b2958214 related-to-bug: 5117434
* Add support for TI H264 encoderDandawate Saket2011-07-121-2/+5
| | | | | | | | | | Add support for TI H264 encoder and quirks for buffer allocation. Temporary switching to baseline profile till ctts patch is defaulted as per profile detection. Change-Id: I1d56184b9c5d5f00d6c63aef7e058f3d56b84cef Signed-off-by: Dandawate Saket <dsaket@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* Do not wait for unlaunched threads in stop()James Dong2011-07-111-9/+24
| | | | Change-Id: If681749753bb96ee98c1539658cfd919eeb0cb65
* Add some error log messages to indicate the failure of a recording sessionJames Dong2011-06-221-4/+22
| | | | Change-Id: I8c5885200bcf6a59736076efc021f07f45a0fdac
* Timestamp adjustment will not work well if we ask video encoder to produce B ↵James Dong2011-06-211-197/+1
| | | | | | frames Change-Id: Ic6a2235fefb6f15081091e1f2c1b12ee92fba5e0
* Merge "Remove unneeded #include <sys/resource.h>"Glenn Kasten2011-06-201-1/+0
|\
| * Remove unneeded #include <sys/resource.h>Glenn Kasten2011-06-151-1/+0
| | | | | | | | | | | | Suggested in code review for previous change. Change-Id: Ic3225b240367dc6c9bf56fb4498fb8a0f9f806ec