summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/MPEG4Writer.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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.
| * Be conservative in estimating the file size limit.James Dong2010-11-301-1/+4
| | | | | | | | | | | | bug - 3045580 Change-Id: Ifdffa354b9433639c3f246a0eb581ef14af1e797
| * Rotation supportJames Dong2010-11-051-19/+62
| | | | | | | | | | | | | | | | | | | | - We only support 0, 90, 180, and 270 degree clockwise rotation - Some players are known to ignore composition matrix in the MP4 file, although this is part of the MP4 file standard. Both QT and YT are supporting the rotation Change-Id: I1b7f66a801e9d9c49d889c9b06dd6173fa7e76c4
* | Removed uncessary FILE structure pointer for I/OJames Dong2010-11-191-29/+37
| | | | | | | | | | | | o also move the fd owner from caller to callee in the Writers Change-Id: I510ccfdd0fcc58f1777fea4ed1349fd251852c65
* | 64-bit file size/offset support for media frameworkJames Dong2010-11-181-41/+46
| | | | | | | | Change-Id: I3452bc2c0f1d990cc67285df2fce1f9f86ff8e10
* | Rotation supportJames Dong2010-11-091-19/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - We only support 0, 90, 180, and 270 degree clockwise rotation - Some players are known to ignore composition matrix in the MP4 file, although this is part of the MP4 file standard. Both QT and YT are supporting the rotation The original patch (65a73f4e8c79d05c0d9001b660325748d4ecf37b) was not merged. The only change I made is to reuse the same kKeyRotation in MetaData.h; and thus do not neeed to use kKeyRotationDegree. Change-Id: Ib328716d4842201c4adf57e4ddfe1f1ac1ae4d8a
* | Added some debugging log messages at stop()James Dong2010-10-291-1/+5
| | | | | | | | | | | | There are so many cases where the codecs just could not stopped ... Change-Id: If9ff261fcd4726c2ee21ec7c9336ca9c2917d399
* | am 6123e0f7: am 1bd8a8c8: Merge "Turn the media time adjustment in file ↵James Dong2010-10-211-2/+5
|\ \ | |/ | | | | | | | | | | | | | | writer back on" into gingerbread Merge commit '6123e0f7c91ffc7534da99b4668879dacf662227' * commit '6123e0f7c91ffc7534da99b4668879dacf662227': Turn the media time adjustment in file writer back on
| * Turn the media time adjustment in file writer back onJames Dong2010-10-211-2/+5
| | | | | | | | | | | | | | | | | | o This was turned off to unblock the tests on some device o The adjustment duration is increased to suppress fluctuations observed on some device bug - 3058745 Change-Id: Iaeeb1c1c52783f5c679305645c995e57b4b2a573
* | am 8ad6335d: am fa7a87fb: Merge "File writer size estimation improvement" ↵James Dong2010-10-211-18/+38
|\ \ | |/ | | | | | | | | | | | | | | into gingerbread Merge commit '8ad6335d2c22900de5b46460473495b5bcea9f99' * commit '8ad6335d2c22900de5b46460473495b5bcea9f99': File writer size estimation improvement
| * File writer size estimation improvementJames Dong2010-10-191-18/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | o Do not count the reserved space for moov if the meta data size is small o Do not count the extra 1KB disturbing small file estimation. o Reduce the default minimum reserved space from 4 KB to 3 KB. o Estimate the moov size based on both duration AND file size limit is set and set it to the smaller estimated value. low risk change bug - 3111983 Change-Id: I6ac2adb979d8cc12d6b4f1813d000c989add0199
* | Make sure we can encode the size of the codec specific data in a single byte.Andreas Huber2010-10-201-0/+3
|/ | | | Change-Id: If7680cbfb380180c8dd6d6019b9c6c67661e468d
* Name the writer threadsJames Dong2010-10-071-1/+8
| | | | Change-Id: I51461c3800ac5850e21ff398e80eb20b562264b3
* Fixed an issue where the reserved free space in the file writer was larger ↵James Dong2010-10-041-2/+14
| | | | | | | | | | | | | | | than intended The problem was that even though user does not explicitly request the max file size limit via MediaRecorder.setMaxFileSize(), the file writer sets an implicit file size limit if 32-bit file offset is used on user's behalf. The reserved free space is estimated based on the file size, if the file size limit is set by the user. The fix is to add an extra bool to tell the difference between an explit requested file size and an implicit file limit and use that to set the estimated moov box size accordingly. Change-Id: I731aca6c7833aa764ed7b905edb77721577471b3
* Resilent media time stamp adjustmentJames Dong2010-10-041-24/+181
| | | | Change-Id: I13ab87c05f26bb11a3cc9bf8559f98e6ea0752db
* Turn off media time adjustment by defaultJames Dong2010-10-011-1/+1
| | | | Change-Id: I1f8021d605d0fd896e0639607a84e3f7c459612e
* Fix track duration calculation if the start timestamp is non-zeroJames Dong2010-09-271-3/+36
| | | | | | | o Updated the comments in the patch o Added some additional checks on the timestamp Change-Id: I8ad81eb6bfe358c1db5245cbb52efc905cdc234c
* Depending on our preference to write 2-byte or 4-byte NALs, patch the codec ↵Andreas Huber2010-09-231-1/+9
| | | | | | specific data 'avcC' accordingly. Change-Id: I1423923fafbcac6911218277e2bbfa068e49dcc6
* Add some explicit error log messagesJames Dong2010-09-141-5/+5
| | | | Change-Id: I8a69157b75a67f0d3c19f05775a8cb0629232299
* When 32-bit offset is used,James Dong2010-09-081-3/+4
| | | | | | | if the requested max file size is greater than the 32-bit offset limit, set the limit to the max 32-bit offset limit. Change-Id: Ie74cbed98469721d4280a0b87491e888948f0046
* Remove unused/debugging code from MP4 file writerJames Dong2010-09-031-204/+47
| | | | | | o also makes nal length in the recorded file modifiable at runtime Change-Id: I731b4dde7070d8d9628b36b523a5b2c011c7c2cf
* Better file size estimateJames Dong2010-09-021-34/+103
| | | | | | | | | When the recorded file becomes large, the metadata size can no longer be ignored. This makes it possible to save the recorded file when the storage becomes almost full at the end of the recording session. Change-Id: Ief038080f825c9946ce550949c03e914aec1e31a
* Calculate audio media drift time from AudioSourceJames Dong2010-09-011-20/+9
| | | | | | | | | | | | | | | | | | | The problem was that the time to receive an output buffer from an audio encoder is different because the encoder does not need to read from the source for all output buffers. This leads to large fluctuation in terms of wall clock duration between two neighboring audio sample outputs from the audio encoder. As a result, the media time for the video track after adjustment using the drifting changes wildly sometimes. This patch addresses this issue by only updating the media drift time when an audio source input buffer is read. the wall clock for the audio track is also calculated at the same time when the input audio buffer is read at AudioSource. bug - 2959800 Change-Id: I3174aa182f744784b540f0a7198524d4eee8bd7b
* Make sure that timestamp does not go backward in MP4 file writerJames Dong2010-08-241-2/+2
| | | | Change-Id: I90745b9df7f19d61f3ab826bf9d2419fe788554e
* Runtime dump support for MediaWriterJames Dong2010-08-231-0/+32
| | | | Change-Id: I10b2c474de612ee4cef4b7c9eae2ee1dd8c2e895
* Don't drop a late frame which may lead to missing I frames in the MP4 fileJames Dong2010-08-191-1/+15
| | | | Change-Id: I8fef1454264230c1369561670236eb0a19ae4e76
* Return error from MPEG4Writer stop() if the check on codec specific data failedJames Dong2010-08-191-0/+26
| | | | Change-Id: Icbd08eec9b4201facbad56ff2040f0830cfb0115
* Make MediaWriter stop and pause return errors if necessaryJames Dong2010-08-191-19/+50
| | | | | | | | | | | o Make the API consistent with SF framework, which the MediaSource provides a return status for stop o Also, helps to convey errors that occurred right when a premature stop() is called, leading to a potentially mal-formed output file. Change-Id: I52a932345f38570fdf8ea04d67d73dd94ccd30ef
* Change the default time scale for audio/video track during recordingJames Dong2010-08-161-8/+51
| | | | | | | | | | | and reduce rounding errors in calculating the sample duration - Default time scale for tracks other than audio is set to 90000. - Audio track by default uses the audio sampling rate as the time scale. - Default movie time scale remains to be 1000. - The default time scale values will be overwritten by a user-supplied value if exits. Change-Id: I81b40ed0626ea45e9fd24a89e21a2c5a4a2c3415
* Use audio clock as the reference media clockJames Dong2010-08-131-0/+65
| | | | | | | | | | | | o Only do this for realtime applications o Adjust other track clock based on audio clock o Assume other track uses wall clock as the media clock o Use some heuristics to reduce the size of stts box by 2/3. - also o Remove one unused key from MetaData.h Change-Id: Ib9432842627b61795b533508158c25258a527332
* Fix a crash due to unnecessary check on the codec config data for H263 video ↵James Dong2010-08-111-2/+2
| | | | | | track Change-Id: I00e8b65d25731153e4d9be6a443eeed91c8fb605
* Only check the codec specific data when the output buffer contains ↵James Dong2010-08-101-85/+6
| | | | | | | | | | | | | | kKeyIsCodecConfig in MP4 writer o Assume there is only a single output buffer containing such information. This simplifies the logic in MP4 file writer o Output SPS and PPS in the very first buffer for software AVC encoder This is to make AVC encoder work with the MP4 file writer o Add timestamp value for codec config data Change-Id: Iad27a04579e6028332429cd0bebd30976041e997
* Support multiple PPS and SPS in avcC boxJames Dong2010-08-091-27/+236
| | | | | | | | | | - Also o do not use the hard-coded profile and levels. Instead, we are using the profile and level found in the codec config data o we are not supporting FRExt profile and levels for now, which requires additional seq parameter set extension for instance. Change-Id: If695b4c996d073d8e48aa45fdd7001e9f016f375
* Fix an issue where the track duration does not include the last sample durationJames Dong2010-08-051-11/+12
| | | | Change-Id: Ib6e01c1c84ad9b7404536f9c40bf90a13340ae53