summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/MPEG4Writer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* video: Use boot clock for recording start timeSurajit Podder2016-04-131-0/+10
| | | | | | | | | | | | | Camera HAL3 uses boot time for buffer timestamp, rather than system monotonic time. This leads to issues as framework uses system monotonic time as reference start time for timestamp adjustment. Add change to use boot time for reference start time. CRs-Fixed: 946735 Change-Id: Id0af9c8aed1a983095275ac03f7f59abc31594cc
* libstagefright: handle error when B-frame is sent to MPEG4Writerxiaoqiny2016-04-131-1/+3
| | | | | | | | | Without this patch, writing B-frame to MediaMuxer will be blocked and cannot return a result. This may cause an endless progress bar shown in gallery when triming or muting some videos. Change-Id: Ib9f902a57da470c0357ec68aab00a35fbb26fb77 CRs-Fixed: 521005
* libstagefright: Allow for MPEG4Writer extensionDeva Ramasubramanian2016-04-131-1/+1
| | | | | | Defer MPEG4 muxer creation to AVFactory. Change-Id: If0918be77ab7f8d82c78203f371df789e3cc29b8
* Fix integer overflow in time conversionMarco Nelissen2016-03-221-1/+5
| | | | | | | | Converting unix epoch time to mpeg4 time requires adding over 2B seconds, which caused an overflow in a calculation involving time_t, which is signed. Bug: 23574783 Change-Id: I21bacc9f5a422091f3c903fb8cf1c760fc078953
* stagefright: Forward-port HFR and HSR supportSteve Kondik2016-01-051-4/+11
| | | | | | * CAF commit bd42a7ac3a60c0d8a079b4567484c9b006bac8ad upstream Change-Id: I457ccab603647f3139ea2199a544f64ac3d1a214
* Merge branch 'LA.BF64.1.2.2_rb4.7' of ↵Steve Kondik2015-11-161-1/+3
|\ | | | | | | | | | | git://codeaurora.org/platform/frameworks/av into cm-13.0 Change-Id: Ia41df61c3ccfeb809572b63a4b1a8ca6bd85dfb2
| * Merge "stagefright: Return error for wrong buffer index in MediaCodec"Linux Build Service Account2015-10-291-1/+3
| |\
| | * stagefright: Return error for wrong buffer index in MediaCodecShalaj Jain2015-10-261-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Return error if the index passed by client is incorrect rather than returning OK with null buffer. Also add a null buffer check in MPEG4Writer as it shouldn't rely on the source returning the correct error code, just as a precaution. Change-Id: Iaefcd57a545ec3ce4ec0b8d4220bdf41377ff798
| * | stagefright: Remove additional deep-copy of encoder buffersShivaprasad Hongal2015-10-261-9/+17
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | MPEG4Writer makes a copy of encoded buffer to avoid holding on to the read buffer. This is not needed with MediaCodecSource, as the encoded-output buffer is already copied to a heap buffer. This saves a copy and some power. However, cloning the buffer is still needed for upstream sources that cannot afford to keep the buffers with writer up until they are released. So, pass a hint in buffer's metadata to indicate if it is OK to delay the release and not copy the buffer Change-Id: Ib59ac29ebc6ce4afd6fc272688a8260438ab1517
* | stagefright: Squashed commit of pause/resume featuresSteve Kondik2015-11-071-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add 2 APIs (suspend/resume) in MediaPlayer - API:suspend() will just pause the player and release all the decoders to replace release() which will release the whole player - API:resume() will just init the decoders again, then start() will be called to restart streaming playback - Add a check in AwesomePlayer::onVideoEvent() to make sure the first seek operation will always seek to the next i-frame Change-Id: Ie4c82906a2a056378119921a656128ebdc1007c4 audio: Add pause support for hardware omx component - ADSP doesn't enter sleep state after wma playback is paused and power suspended. - No support for NT session pause in case of hardware component. NT session need to be paused to put ADSP into power collapse. - Add support of pause in stagefright to ensure device enters suspend mode. Also add intermediate states to avoid concurrency issues between read and pause. Change-Id: I41b946b8c8805e6ee303646b63513b5b16514ef6 libstagefright: Drain input buffer on resume - Buffers returned from codec in paused state are not drained. When codec is resumed these buffers are not drained until the next flush, and may cause timed out issue. - Added change to drain input buffers for sw decoders when resuming. Change-Id: Ida2ab1d5dc3a1910accdd6fb89548262a912d8e7 CRs-Fixed: 569585, 574967 libstagefright: camcorder pause-resume implementation - Add pause resume feature in camcorder app. So that user can pause recording and resume later which results in a single recorded clip. Change-Id: Id19c45ae5bb85265aa4d5304b160ebf119d9575a libstagefright: support pause/resume for timelapse recording Modify the timestamp calculation mechanism in CameraSourceTimeLapse in order to support pause/resume. Change-Id: Icb02ea798b0b807ffb7ada2d1ef5b2414b74edfb
* | Revert "video: Avoid writing 0 sample count ctts entry"Pradosh Das2015-10-291-5/+1
| | | | | | | | | | | | This reverts commit 1c3512e861768125048e675966e3d8a7669bf4fa. Change-Id: I8a04c3035437f4aefa8c49ccdc2565c54a3831be
* | video: Avoid writing 0 sample count ctts entrySurajit Podder2015-10-291-1/+5
| | | | | | | | | | | | | | | | | | | | | | After the initial ctts entry is written, cttsSampleCount is set to 0, and the next ctts is written with 0 sample count. Add change to write ctts entry only for non-zero sample count. Change-Id: I457c3c9bdd402138338c340db4187f1d2b9bdbe6
* | stagefright: Remove additional deep-copy of encoder buffersShivaprasad Hongal2015-10-291-9/+17
|/ | | | | | | | | | | | | | MPEG4Writer makes a copy of encoded buffer to avoid holding on to the read buffer. This is not needed with MediaCodecSource, as the encoded-output buffer is already copied to a heap buffer. This saves a copy and some power. However, cloning the buffer is still needed for upstream sources that cannot afford to keep the buffers with writer up until they are released. So, pass a hint in buffer's metadata to indicate if it is OK to delay the release and not copy the buffer Change-Id: Ib59ac29ebc6ce4afd6fc272688a8260438ab1517
* video: Modify classes to support camcorder pause/resumeSurajit Podder2015-10-061-2/+4
| | | | | | | | | * Modify MediaRecorder, CameraSource, AudioSource to be extendable. * Add hooks to instantiate extended implementations to implement pause/resume. Change-Id: I847263fc69e4f613c5ea60fb6809c7da176d3a8d
* video: Port AOSP fixesSurajit Podder2015-10-061-2/+7
| | | | | | | | | | | | Includes following fixes: f510d0c libstagefright: Disable multi slice mode for video encode ca46843 audio: Fix for failure in CTS MediaRecorderTest cases b4d0490 libstagefright: check the audio source when adding to MPEG4Writer 89c6c3f libstagefright: Allocate cached camera buffers for sw encoders f2c387b libstagefright: Choose target specific media_codecs.xml f3e7122 libstagefright: Implement fallback mechanism to SW decoder Change-Id: I90398b2fead1f4e163935bf1db342e24275f7933
* libstagefright: MPEG4Writer: Add support for HEVC muxingLubin Yin2015-10-061-7/+41
| | | | | | | | | | | | Changes done to enable HEVC muxing - writing HVCC atom - configure HEVC encoder Fix HEVC flag initialization Check for HEVC for single track usecase Change-Id: I1757d0c442e7cc3ef251431f220395131a1eb4ec
* Stagefright: Add Checks for allocationsSathishKumar Mani2015-10-061-0/+5
| | | | | | | Warn allocation failures explicitly rather than crash trying to access unallocated memory Change-Id: Ie86c3ac130917e1f4030eb8207ac8350cba7711d
* Audio: post error to client during SSRDhanalakshmi Siddani2015-10-061-2/+7
| | | | | | | - Add support to post error to client if SSR is triggered during NT mode encoding Change-Id: Idf10939f1eb0c719a692e4f53f6e3040633fab40
* MPEG4Writer: Fix MediaServer crash in MM Stress test.Paras Nagda2015-10-061-0/+5
| | | | | | | | | | | | | - Media Server crash is happening while accessing codecspecific data at the end of recording since stopRecording is issued from script even before codec spefic data is returned from encoder. - Size check is added to prevent accessing codecspecific data in this case. CRs-Fixed: 732893 Change-Id: I77ce3c02c76c4d3cc4345d761ad505090ef29530
* libstagefright: Allow multi-byte CSD sizes for non-m4v clipsLeena Winterrowd2015-10-061-2/+3
| | | | | | | | | | As per ISO/IEC 14496-15, there is no explicit limit on the size of codec-specific-data for AVC clips. Only mpeg4 video requires that CSD size must fit within a single byte. Make the assertion enforcing this condition specific to m4v content. CRs-Fixed: 724526 Change-Id: Id006030ac65d5ec0bf285c040e4c536039f9489b
* libstagefright: Use proper ctts offsetSurajit Podder2015-10-061-2/+2
| | | | | | | | | | Calculate ctts offset as difference between composition time and decoding time, and avoid adding kMaxCttsOffsetTimeUs as it increases the sample timestamp by the same amount which leads to av sync loss for B-frames. CRs-Fixed: 524739 Change-Id: I75a1bb594536623e3a445af2ee1ceb0cf0926a6e
* libstagefright: Use 3gp4 ftyp box when AMR audio is presentLeena Winterrowd2015-10-061-3/+7
| | | | | | | | | | | mp42 boxes do not support the 'damr' box type whereas 3gp4 boxes explicitly support it. Using mp42 makes clips with AMR incompliant with mpeg4 standards and unplayable by many media players. To ensure interoperability, use a 3gp4 box if the recorded clip contains AMR audio. CRs-Fixed: 721883 Change-Id: I75e3558cd5088d05d36104abfb04a3c0c1d1a4e7
* libstagefright: Fix MPEG4Writer crash when internal memory is almost full.Paras Nagda2015-10-061-1/+5
| | | | | | | | | | | | | | - Camcoder recording crashes when internal memory is almost full. - crash happens if there is no space to write even first video frame. as soon as first video frame comes file limit exceeded information is given back to recorder and timestamp of video is not updated. since video timestamp is not proper crash is seen when comparing it with audio timestamp. - check is added while doing comparision of timestamps and reporting error in track stop() so recorded file is not saved to memory. Change-Id: I69e8bad62ab03ce01de5cbdb13f8ea841b787fcb
* Merge "MPEG4Writer: add check to ensure no integer overflow on allocation." ↵Wei Jia2015-06-081-0/+2
|\ | | | | | | into mnc-dev
| * MPEG4Writer: add check to ensure no integer overflow on allocation.Wei Jia2015-06-041-0/+2
| | | | | | | | | | Bug: 20674584 Change-Id: I77ef1891abf0a20994840a87fa99e55a62f40a70
* | MPEG4Writer: fail init check if output fd is not seekableRobert Shih2015-06-051-0/+7
|/ | | | | Bug: 12239375 Change-Id: Id1e23b3803f0ed48e4d1ad3ec4b84c4a39325ddd
* MPEG4Writer: fix unintiialized member variablesChong Zhang2015-05-151-0/+7
| | | | | bug: 20858729 Change-Id: Iccd62dca311fa66cb52ef53ed703719ddcf92cc8
* stagefright: Validate track formats passed to MPEG4WriterPraveen Chavan2015-05-051-20/+35
| | | | | | | | | | | Validate the mime type for tracks to start with; and throw an error for unsupported types rather than let apps re-mux/encode the whole clip and assert towards the end while writing the header. The writer asserts if provided with an unsupported mime when authoring the fourcc, which is done at the end of muxing. Bug: 17007397 Change-Id: Ie80372940a46038db73107101a2ae6fdecf72eaa
* stagefright: make more warnings errorsLajos Molnar2015-04-171-1/+3
| | | | Change-Id: I9b1ad60fbfb866dbf9c00843e06553c3eb25c113
* stagefright: warnings be gone, some are now errors, use clangLajos Molnar2015-04-171-2/+2
| | | | Change-Id: I81f438ae444f04c12ae27ae4ef6d073033de172c
* am 5c16a387: am 382bcd5a: am 6a2dffb1: am 4491a4ab: Merge "libstagefright: ↵Lajos Molnar2015-04-161-0/+2
|\ | | | | | | | | | | | | free mMoovBoxBuffer" * commit '5c16a3877c0b32f21cbee7f1bdc77a2a4d2b79c6': libstagefright: free mMoovBoxBuffer
| * Merge "libstagefright: free mMoovBoxBuffer"Lajos Molnar2015-04-161-0/+2
| |\
| | * libstagefright: free mMoovBoxBufferSuresh Choudhary2015-04-161-0/+2
| | | | | | | | | | | | | | | | | | Add free(mMoovBoxBuffer) in MPEG4Writer::release() Change-Id: Ic396e64e9e238bdc23cb0b02b7aa341d879d2237
* | | am f16511ca: am 0a4d22e5: am 9985f6af: am 30d7b488: Merge "MPEG4Writer: Set ↵Lajos Molnar2015-04-161-2/+4
|\ \ \ | |/ / | | | | | | | | | | | | | | | the correct audio bit rate for camera recorded content" * commit 'f16511ca737b8bf8a33ce589a28630e98c3aaae5': MPEG4Writer: Set the correct audio bit rate for camera recorded content
| * | MPEG4Writer: Set the correct audio bit rate for camera recorded contentDaniel Bonnevier2015-04-151-2/+4
| | | | | | | | | | | | | | | | | | | | | Remove the hard coded value for bit rate. Use the audio bit rate from the stream format, if it is specified, otherwise default to 96kpbs. Change-Id: Ib643c79bbdddaafb3dc703448645606267f7ca4d
* | | MPEG4Writer: add software version to mp4 metaChong Zhang2015-02-251-10/+61
| | | | | | | | | | | | | | | | | | | | | | | | and account for meta data and geo data when estimating moov size bug: 19460202 Change-Id: I094d15f47dda5e41217181cdb3ac519c00330de5
* | | MPEG4Writer: add capture fps in meta dataChong Zhang2015-02-231-0/+110
| | | | | | | | | | | | | | | | | | bug: 19460202 Change-Id: I3a6ea3a5149d124ca9a2487a300dcc2db4405d0f
* | | Remove filename based writer constructorsMarco Nelissen2014-12-101-25/+0
|/ / | | | | | | | | | | | | MediaPlayerService can't open files (it needs an already opened file descriptor), so these were just wasting space. Change-Id: I323044a6c1814a7bff952ed71b5c7792df2abf03
* | 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