summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/MPEG4Writer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* | Use system property to control whether we will enable B frame support in ↵James Dong2011-06-171-1/+11
|/ | | | | | | | | | MPEG4Writer o This is to work around a bug in crespo's video encoder output timestamp related-to-bug: 4600191,4724339 Change-Id: I485c1e044bd2f604b318692efd6433345cfc6487
* Merge "Bug 4608375"Glenn Kasten2011-06-141-1/+1
|\
| * Bug 4608375Glenn Kasten2011-06-141-1/+1
| | | | | | | | | | | | Update priority and policy together for audio threads Change-Id: Ib3b07b32586c222c4aacbf23414ae8b05db502be
* | Add B frame support for MPEG4WriterJames Dong2011-06-131-9/+118
|/ | | | | | o requires the support of negative ctts duration values (ctts version 1) Change-Id: Ib14130c9359c3bff3c76f20a7380d468a065dcaf
* Avoid duplicated code calculating the stts sample durationJames Dong2011-06-101-22/+21
| | | | | | | o This also speeds up the MediaRecorder.stop() call. o Also fix incorrect start time compensation in stts box Change-Id: I6392b8b980e0f786ddeeec0fe2c341de67208c6f
* Fix an issue in MPEG4Writer where the write of outstanding chunks in the ↵James Dong2011-06-091-0/+1
| | | | | | last batch was missing Change-Id: I93c9f6ae7ed098cdf828b2b11a9273c9e0c244e3
* Fix the comment for the location box @xyzJames Dong2011-06-031-2/+2
| | | | Change-Id: I5347e346eef40a8ba90e7a3fa786b4654d18606b
* Revert "Add const to the finders method in MetaData.cpp"James Dong2011-05-171-1/+1
| | | | | | | | | | This reverts commit 78fed171d9d62b25aa846d7373a7040e3fd2241e. Conflicts: include/media/stagefright/MPEG4Writer.h Change-Id: Ie6f497f67a473ad95b50bb949c1aa49e1804bac3
* Make track informational event optional, depending on system propertyJames Dong2011-05-171-0/+31
| | | | | | o also add a track informational event to return the encoded data in kilo-bytes Change-Id: I7c383360d57048c8a3606d0b8141ba53e4f4b224
* Support platform and camera dependent recording start time offsetJames Dong2011-05-141-10/+24
| | | | | | related-to-bug: 4390777 Change-Id: Icb52973ad4ac716f04fb103ef527915a966d06d5
* Support for storing geo information in the recorded mp4/3gpp file.James Dong2011-05-131-2/+107
| | | | | | | o Geo data (latitude and longitude) is stored in udta box Change-Id: I76e4aeb741c4b339f3753d3d28190151f3ea4919 related-to-bug: 4260295
* Track id really starts with 1, not 0James Dong2011-05-131-1/+1
| | | | Change-Id: I55dcfdc2dc2a64285dfa93024f7b885210cc827e
* Add send session recording summary report to applicationJames Dong2011-05-091-15/+51
| | | | Change-Id: I9c63ddae432f0c93486c39776ed0a058a8649602
* Add const to the finders method in MetaData.cppJames Dong2011-05-091-1/+1
| | | | | | o also fixed the MPEG4Writer writeFtypBox() to take a const pointer to MetaData Change-Id: Iaecdbe6aeab345f6dc72aac0d19f9704b6e0d28a
* Add end of recording summary track infoJames Dong2011-05-091-3/+36
| | | | | Change-Id: I2fcf589e70db225776ef7c8d0f28505ceb824c45 related-to-bug: 1854633
* Refactor MPEG4Writer::writeTrackHeader() methodJames Dong2011-05-091-420/+520
| | | | | | | o most of the mp4 file boxes has its own method now TODO: remove some of the duplicated code for esds box, for instance. Change-Id: Iae3dbb2410b79bc79aaee081b80569d339993c47
* Add read and write option in opening file for output in the writersJames Dong2011-03-211-1/+1
| | | | Change-Id: Ibfba0aacd3c8587c04a2e903b636de337cc30104
* Better organize media recorder error and information event and typesJames Dong2011-03-181-20/+20
| | | | Change-Id: I45f1f953596985494725525c1fabf57eccc19175
* A/V synchronization at the beginning of a recording sessionJames Dong2011-02-171-23/+37
| | | | | | | | | | | | | o do not use edts/elst boxes since these optional boxes are ignored o manipulate the first video/audio frame duration to make sure that the rest of the audio/video is in sync (ideally, we should only manipulate the vidoe frame duration, not the audio) o reduce the initial audio mute/suppression period, which is used to eliminate the "recording" sound. bug - 3405882 and 3362703 Change-Id: Ib0acfb4f3843b365157288951dc122b006299c18
* Reduce blocking time in file writeJames Dong2011-02-091-37/+49
| | | | | | bug - 3418787 Change-Id: I4723662bf46ed07271be8468f84ae5d93cb793fa
* Report errors to applications if AudioRecord->start() failsJames Dong2011-01-251-1/+8
| | | | | | bug - 3385198 Change-Id: I86ac8071eb28a538b333e102192193d1b9eda5eb
* Logging the duration range from different media tracks for recordingJames Dong2011-01-191-0/+9
| | | | Change-Id: I8c3edcf97ce35301f8645e4a1e232d9bfc2c0349
* Yield the omx threads so that file writer threads have a chance to retrieve ↵James Dong2010-12-131-0/+2
| | | | | | | | the output buffers once they become ready bug - 3252228 Change-Id: Iab7cf1c9a87cce7b814c63b42b21fcd6a7314b36
* am 80639875: am d4c5478a: Merge "Be conservative in estimating the file size ↵James Dong2010-12-021-1/+4
|\ | | | | | | | | | | | | limit." into gingerbread * commit '806398755fdc63438b607856574e5b885ad98e6b': Be conservative in estimating the file size limit.