summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/StagefrightRecorder.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | resolved conflicts for merge of a127c07c to masterKenny Root2010-10-141-0/+56
|\ \ | |/ | | | | Change-Id: Ifdfc6681cba00f36456eaf7a97f34a75b9d0c086
| * Support for writing to MPEG2 transport stream files.Andreas Huber2010-10-121-0/+50
| | | | | | | | Change-Id: If3b7a807bc224a4b1cb2236537c3ebdc5aee0d97
* | Move Camera specific logic out from StagefrightRecorder to CameraSourceJames Dong2010-10-081-161/+11
| | | | | | | | | | | | | | o updated comments and streamlined the logic in checkVideoSize() and checkFrameRate() as suggested Change-Id: I49d04ac7998d4a215997aa63555dfb6e814e38d3
* | Use setVideoSize API in StagefrightRecorderJames Dong2010-10-041-2/+68
| | | | | | | | Change-Id: Ia7ddf5e8d2b931453d2cb801169906191349ca07
* | Implemented frequent read returns for quick stop in time lapse.Nipun Kwatra2010-09-171-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the frame capture interval is large, read will block for a long time. Due to the way the mediaRecorder framework works, a stop() call from mediaRecorder waits until the read returns, causing a long wait for stop() to return. To avoid this, we return a copy of the last read frame with the same time stamp if a frame is not available quickly. This keeps the read() call from blocking too long. This method is triggered when startQuickReadReturns() is called on CameraSourceTimeLapse. In the still camera case, also using waitRelative on Condition instaed of sleeping, so that we can wake it up. Also for the idle check instead of sleeping, we now wait on a condition variable, which is woken up when the last takePicture callback gets called. Change-Id: Ia74386e175536aee0f44ae2f8b114c353d3d72f5
* | Checks for auxiliary video recording.Nipun Kwatra2010-09-141-2/+10
| | | | | | | | | | | | | | | | - Check that time lapse mode is on when using auxiliary video recording. - Check that auxiliary video size is strictly less than the main video size. Change-Id: Ic49d25e6ac30f6f885ce4f5fb38dbe0cc7bc1be1
* | Moving decision to use still camera to CameraSourceTimeLapseNipun Kwatra2010-09-031-23/+4
| | | | | | | | | | | | | | | | | | | | | | | | CameraSourceTimeLapse now decides whether to use still or video camera automatically. It checks if the passed in size is a valid preview size and if it is, then uses the video camera else uses the still camera. Removed from StagefrightRecorder the support to set parameter useStillCameraForTimeLapse. Change-Id: I71f5b0fc7080ca524792381efe918d22e41a7f36
* | Support for auxiliary video parameters.Nipun Kwatra2010-09-011-9/+80
| | | | | | | | | | | | | | | | Added support for passing width, height and video bitrate for the auxiliary video. Also setting encoder level depending on the video size and bitrate. Change-Id: I4a90046853f67287c3e7e6babc75b4827f0c3e73
* | Adding support for parallel recording sessions.Nipun Kwatra2010-08-311-29/+173
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added setOutputFileAuxiliary to pass the auxiliary file descriptor. The java interface through JNI will be checked in next. - renamed setupCameraSource to setupCamera as the function just sets the camera. - Added setupCameraSource which sets up the camera source. This functionality was in setupVideoEncoder before. - setupVideoEncoder now takes in a cameraSource instead of creating it on it own. - Refactored startMPEG4Recording() to use setupMPEG4Recording, setupMPEG4MetaData. - setupMPEG4Recording() takes in file descriptor, bitrates to setup a mpeg4 writer. This function can be called multiple times to setup multiple writers. - Added setupMPEG4MetaData() for setting up the meta data for mpeg4 writer. startMPEG4Recording() now calls setupMPEG4Recording, setupMPEG4MetaData for each recording session. Change-Id: I07f5334a1ff8e12a36f58e94129fcfa6add2208b
* | am 28a92120: am 3f51fa78: Runtime dump support for MediaWriterJames Dong2010-08-241-2/+10
|\ \ | |/ | | | | | | | | | | Merge commit '28a92120a702289533a9c9d004bd60f83b2fd98b' * commit '28a92120a702289533a9c9d004bd60f83b2fd98b': Runtime dump support for MediaWriter
| * Runtime dump support for MediaWriterJames Dong2010-08-231-2/+10
| | | | | | | | Change-Id: I10b2c474de612ee4cef4b7c9eae2ee1dd8c2e895
* | am 701b710c: am 300b0b7e: Merge "setParamMaxFileDurationUs should allow zero ↵Nipun Kwatra2010-08-241-1/+5
|\ \ | |/ | | | | | | | | | | | | | | time input as per API of setMaxDuration." into gingerbread Merge commit '701b710c194181765616520f6d89d450b4b6c1f5' * commit '701b710c194181765616520f6d89d450b4b6c1f5': setParamMaxFileDurationUs should allow zero time input as per API of setMaxDuration.
| * setParamMaxFileDurationUs should allow zero time input as per API of ↵Nipun Kwatra2010-08-201-1/+5
| | | | | | | | | | | | | | | | | | | | setMaxDuration. according to MediaRecorder::setMaxDuration documentation we should disable duration limit when zero or negative time is passed. Currently setParamMaxFileDurationUs was treating zero/negative as an error case. Fixed that. Change-Id: I468c3bcc74cb5a34ee3e172cef5147550d6be096
* | Change the framework to use the new camera preview path.Jamie Gennis2010-08-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | This change makes the camera HAL interface take an ANativeWindow interface from which all the camera preview buffers will be allocated. The framework code running in application processes now passes a Surface object rather than an ISurface to the camera server via Binder when setting the preview surface. The camera server then forwards that Surface object (which implements the ANativeWindow interface) to the camera HAL, which uses it to communicate with SurfaceFlinger to allocate the camera preview buffers. Change-Id: Ie438f721559cd7de5e4f848a26d96360dda07b5f
* | am c8d2fa70: am cbd038fe: Merge "Make MediaWriter stop and pause return ↵James Dong2010-08-211-2/+3
|\ \ | |/ | | | | | | | | | | | | | | errors if necessary" into gingerbread Merge commit 'c8d2fa704abebdbf0bd8aac185216dc068950217' * commit 'c8d2fa704abebdbf0bd8aac185216dc068950217': Make MediaWriter stop and pause return errors if necessary
| * Make MediaWriter stop and pause return errors if necessaryJames Dong2010-08-191-2/+3
| | | | | | | | | | | | | | | | | | | | | | 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
* | am f54da15b: am eff30e3d: Change the default time scale for audio/video ↵James Dong2010-08-161-6/+12
|\ \ | |/ | | | | | | | | | | | | | | track during recording and reduce rounding errors in calculating the sample duration Merge commit 'f54da15b7c3fa55268451c485544e831832fdf15' * commit 'f54da15b7c3fa55268451c485544e831832fdf15': Change the default time scale for audio/video track during recording
| * Change the default time scale for audio/video track during recordingJames Dong2010-08-161-6/+12
| | | | | | | | | | | | | | | | | | | | | | 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
* | am 0386d04b: am 581581fe: Merge "Fix all fd leaks in authoring engine" into ↵James Dong2010-08-121-5/+5
|\ \ | |/ | | | | | | | | | | | | | | gingerbread Merge commit '0386d04b19619b03b6bce830010e11d31d3f8a5c' * commit '0386d04b19619b03b6bce830010e11d31d3f8a5c': Fix all fd leaks in authoring engine
| * Fix all fd leaks in authoring engineJames Dong2010-08-111-5/+5
| | | | | | | | Change-Id: I17798543f9dd41cc8bef6f6086e66932f9f97be8
* | When using still camera for time lapse capture, don't set preview.Nipun Kwatra2010-08-051-6/+7
| | | | | | | | | | | | | | | | Since HD resolution may not be supported by the video camera, don't set preivew using the HD size. The app should have set the preview already, just use that. Change-Id: I2f8e89bf2c7440f7bc8db7e4a228f4c8250d92b4
* | am 1f513d88: am c17f35dd: Merge "Support for Gtalk video, includes AMR/H.263 ↵Andreas Huber2010-08-051-3/+46
|\ \ | |/ | | | | | | | | | | | | | | assembler and packetization support, extensions to MediaRecorder to stream via RTP over a pair of UDP sockets as well as various fixes to the RTP implementation." into gingerbread Merge commit '1f513d8821670a33d6361ea521b6756163a3f9bf' * commit '1f513d8821670a33d6361ea521b6756163a3f9bf': Support for Gtalk video, includes AMR/H.263 assembler and packetization support, extensions to MediaRecorder to stream via RTP over a pair of UDP sockets as well as various fixes to the RTP implementation.
| * Support for Gtalk video, includes AMR/H.263 assembler and packetization ↵Andreas Huber2010-08-041-3/+46
| | | | | | | | | | | | support, extensions to MediaRecorder to stream via RTP over a pair of UDP sockets as well as various fixes to the RTP implementation. Change-Id: I95b8dd487061add9bade15749e563b01cd99d9a6
* | am d152c1c7: am d194f3d6: Merge "Replace CHECK with a failure return value ↵James Dong2010-08-041-1/+7
|\ \ | |/ | | | | | | | | | | | | | | when mCamera->setParameters() fails if the camera is locked by someone else." into gingerbread Merge commit 'd152c1c7534a80b84f6b389efa8a410ea359b3eb' * commit 'd152c1c7534a80b84f6b389efa8a410ea359b3eb': Replace CHECK with a failure return value when mCamera->setParameters() fails
| * Replace CHECK with a failure return value when mCamera->setParameters() failsJames Dong2010-08-031-1/+7
| | | | | | | | | | | | | | | | if the camera is locked by someone else. bug - 2827892 Change-Id: I217d4a00f04ebd57b557d3faef28787c14f23ea0
* | Allowing useStillCameraForTimeLapse to be set through MediaRecorder.javaNipun Kwatra2010-08-021-1/+20
| | | | | | | | | | | | | | | | | | | | This will allow apps to make the decision of whether to use still image mode or video mode for time lapse capture. - setTimeLapseParameters now takes in a useStillCameraForTimeLapse parameter. - Added support in StagefrightRecorder for passing through this parameter. Change-Id: Iafbcb76f9a7903118ea5eb822c81008619630f03
* | am e915b0ef: am d973a533: Merge "Lower the lower bound for max file duration ↵James Dong2010-07-301-1/+1
|\ \ | |/ | | | | | | | | | | | | | | check" into gingerbread Merge commit 'e915b0ef5d574022dfeffc9b2b61e21c1433c89c' * commit 'e915b0ef5d574022dfeffc9b2b61e21c1433c89c': Lower the lower bound for max file duration check
| * Lower the lower bound for max file duration checkJames Dong2010-07-301-1/+1
| | | | | | | | | | | | - This fixed a CTS test where 200 ms is being used Change-Id: Ib598b7b94be54e98a96703c58c5f244bc379cf7d
* | am cb51115c: am 5587bb7e: Merge "Interleave the audio and video by default - ↵James Dong2010-07-281-2/+4
|\ \ | |/ | | | | | | | | | | | | | | default interleave duration is set to 1 second" into gingerbread Merge commit 'cb51115cca81ba47d00aa344f6ed16d1056b056b' * commit 'cb51115cca81ba47d00aa344f6ed16d1056b056b': Interleave the audio and video by default
| * Interleave the audio and video by defaultJames Dong2010-07-281-2/+4
| | | | | | | | | | | | | | | | | | - default interleave duration is set to 1 second This can dramatically reduce the memory usage by the MP4 file writer. Change-Id: Ia3ff202cabfcd2d3f183065d31e4596617c2dded
* | Allowing setting of time lapse parameters through MediaRecorder.javaNipun Kwatra2010-07-221-8/+59
| | | | | | | | | | | | | | | | added setTimeLapseParameters() to MediaRecorder.java and SetParameter support in StagefrightRecorder to allow enabling time lapse and setting the corresponding parameters. Change-Id: I509040aa71f8d3fc37337b0894a81d9c0fd7a40a
* | am 9049fe60: am d7514ec6: Merge "Progress status notification" into gingerbreadJames Dong2010-07-201-21/+0
|\ \ | |/ | | | | | | | | | | Merge commit '9049fe60c20640bd606741c8f45f3f781a1684f5' * commit '9049fe60c20640bd606741c8f45f3f781a1684f5': Progress status notification
| * Progress status notificationJames Dong2010-07-201-21/+0
| | | | | | | | | | | | - Keep track of per-track progress Change-Id: Ibd36f0e8c78581928c8aa2f5e23c5e7e0615c2cc
* | Use software encoder for time lapse capture.Nipun Kwatra2010-07-201-1/+3
| | | | | | | | Change-Id: I7f60eb1af95590c84b0cd98134f5a5a8963338dd
* | Adding support for timelapse capture using still camera's takepicture.Nipun Kwatra2010-07-191-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also moving entire implementation into a new class CameraSourceTimeLapse which inherits from CameraSource. For timelapse capture using still camera, we start a thread which runs a loop in which it calls Camera::takePicture() and then sleeps until the next frame should be captured. The function dataCallback() handles the callback from the camera with the raw image data. This function copies the data and creates an artificial timestamp corresponding to one frame time ahead of the last encoded frame's time stamp. It then calls dataCallbackTimestamp() of the base class which will think that it recieved the frame from a video camera and proceed as usual. For moving the implementation to the subclass CameraSourceTimeLapse, added a few virtual functions to CameraSource, which do the current thing for the base class, but specialized things for CameraSourceTimeLapse. E.g. startCameraRecording() in the base class just calls mCamera->startRecording(), while in CameraSourceTimeLapse it may start a thread for the still camera case. Change-Id: Ib787f24bd2e1f41681513f0257e1c4ca10a2b4de
* | am b068b47c: am d6a85a21: Merge "Support user-supplied timescales for ↵James Dong2010-07-151-12/+72
|\ \ | |/ | | | | | | | | | | | | | | authoring" into gingerbread Merge commit 'b068b47c6d0214256116a0c661740bddf7acc18c' * commit 'b068b47c6d0214256116a0c661740bddf7acc18c': Support user-supplied timescales for authoring
| * Support user-supplied timescales for authoringJames Dong2010-07-141-12/+72
| | | | | | | | | | | | - also, change all the real time unit to microseconds in MPEG4Writer Change-Id: I260f512f2eb670ade7b8858a56335a5d639de756
* | am f6bdc764: am 9d8bea11: Merge "Initial checkin for software AVC encoder" ↵James Dong2010-07-131-1/+3
|\ \ | |/ | | | | | | | | | | | | | | into gingerbread Merge commit 'f6bdc764b7a21f8037504e1dc4f81227ea2bedea' * commit 'f6bdc764b7a21f8037504e1dc4f81227ea2bedea': Initial checkin for software AVC encoder
| * Initial checkin for software AVC encoderJames Dong2010-07-131-1/+3
| | | | | | | | | | | | | | | | | | | | - Since the software encoder assumes the input is YUV420 planar, color conversion needs to be added when the input color format does not meet the requirement. With this patch, I only added a single color conversion from YUV420 semi planar to YUV420 planar. We can add more as we go. Change-Id: If8640c9e5a4f73d385ae9bb2022e57f7f62b91b9
* | am 4f440632: am 929642ee: Add runtime dumpsys support for media recorder clientJames Dong2010-07-091-0/+60
|\ \ | |/ | | | | | | | | | | Merge commit '4f4406322dafd6e128b437edbc541327f0b38d04' * commit '4f4406322dafd6e128b437edbc541327f0b38d04': Add runtime dumpsys support for media recorder client
| * Add runtime dumpsys support for media recorder clientJames Dong2010-07-081-0/+60
| | | | | | | | Change-Id: I4c8a81720f3be2db54678a7e84fe12849255046b
* | am b3598832: am c4243342: Merge "Allow application to set two more encoding ↵James Dong2010-07-071-0/+38
|\ \ | |/ | | | | | | | | | | | | | | paramters: video profile and level" into gingerbread Merge commit 'b35988329ac1a574898db9226039e37e352c57a8' * commit 'b35988329ac1a574898db9226039e37e352c57a8': Allow application to set two more encoding paramters: video profile and level
| * Allow application to set two more encoding paramters: video profile and levelJames Dong2010-07-071-0/+38
| | | | | | | | Change-Id: I673e681cefe184d5c556c612c54600a24a2143e5
* | Adding timelapse capture from videocamera.Nipun Kwatra2010-07-011-1/+5
|/ | | | | | | | | | | Current implementation looks at the timestamps of all incoming frames in CameraSource::dataCallbackTimestamp(). It drops all frames until enough time has elapsed to get the next time lapse frame. When enough time has passed to capture the next time lapse frame, the frame is no longer dropped and the timestamp of this frame is modified to be one frame time (1/framerate) ahead of the last encoded frame's time stamp. Change-Id: I82b9d5e96113dffa6901aac3b8a8ef999ffc1d0b
* Refactor Stagefright::StartMPEG4Recording()James Dong2010-07-011-151/+179
| | | | | | - Also, better error handling Change-Id: Ic18d08dc6489adf92c6a588efa4baca66429b175
* Added encoding parameters set up for H263 video encoderJames Dong2010-06-291-17/+95
| | | | | | | | Also: - Allowed start() call when encoder already starts and stop() call when encoder has not started yet - Handled default value for audio/video sources/encoders and file output format Change-Id: I03b2f7d3cf570baa0fd011a8c0ad200f2f2a5da1
* Separate MediaRecorderClient with MediaPlayerClientJames Dong2010-06-281-1/+1
| | | | | | | | | | - An alternative would be to define a common base class that both MediaRecorderClient and MediaPlayerClient can derive. But since the common code, onTransact() and notify() uses some Binder code, having a common base class may not gain us too much in terms of code reuse. Change-Id: Ibc06720278ad173fceacff3d267b7060856c6316
* Provide progress status report during authoringJames Dong2010-06-251-14/+67
| | | | | | | | | - Track either the number of A/V frames authored, or the time elapsed - Track the completion of the authoring - Add multiple camera support for authoring by accepting a camera id parameter - Set file type based on the OUTPUT_FORMAT requested Change-Id: I0f9d31b3b7a8fa43eb53f572410fb0ebd4fa0bb7
* Enable passing parameters to the MediaWriter at runtime (at start() call).James Dong2010-06-251-4/+22
| | | | | | | | | | - estimate the moov box size for mp4 file writer based on the file size/duration limit and target bit rate. - can switch to use 64 bit file offset at runtime rebased Change-Id: Ibbe1f57e91ab2605820d5d96e8048d11e5559c53
* Track maximum amplitude and fix getMaxAmplitude()James Dong2010-06-241-1/+7
| | | | | | - only start to track the max amplitude after the first call to getMaxAmplitude() Change-Id: I64d3d9ca0542202a8535a211425e8bccceca50fc