1111 Commits

Author SHA1 Message Date
Chong Zhang
e0c465fefa MediaCas: address comments for API reviews
am: addc39ec27

Change-Id: Ib4bb32cc09d9352bdbc4913dfdfdf1e92c11487f
2017-04-13 06:32:28 +00:00
Chong Zhang
addc39ec27 MediaCas: address comments for API reviews
- Wrap session id byte array in Session object

- Move session operations from MediaCas to Session

- Remove position prarameters on descramble() method

- Retrieve cas info for a track by getCasInfo() instead
  of getDrmInitData().

bug: 22804304
bug: 36791613
bug: 36783335

Change-Id: Ib3ad8d6a2f679c0e60d2bb025ac5999339722306
2017-04-11 13:13:22 -07:00
Zhijun He
916d8ac650 ImageReader/Writer: add usage flag support
Also add an ImageWriter ctor to take additional arugment (format)

Test: ImageReader and Writer CTS tests
Bug: 32766711
Change-Id: I99e3862dd5b9a85c9df7879c14c84b68a35718ec
2017-04-10 23:38:32 +00:00
Ray Essick
ed5b028693 Move MediaMetrics into its own library
Changes for the new HAL structure have brought about a build time
circular dependency between libmedia and libmediadrm. This set of
changes the media metrics code into its own library and arranges
for the relevant consumers of the media metrics code to link
to this new library (where they had previously picked it up by
including libmedia).

Bug: 36990807
Test: build, boot.
2017-04-05 14:01:00 -07:00
Mathias Agopian
845eef05ff Remove useless GraphicBuffer() constructor
Test: compiled & run
Bug: 36869708
Change-Id: Ie825979cd03874904b6f953ece4a05d4a0d52253
2017-04-03 17:51:15 -07:00
Chong Zhang
dadee0c33e MediaCas: rethrow MediaCas specific exception
Translate ServiceSpecificException from aidl to CAS-specific
exceptions. Also, throw CAS specific exception for descramble().

bug: 22804304

Change-Id: I6d68c335c87fbb95fd8cc227e432eed4e5951550
2017-03-24 14:28:43 -07:00
Jerry Zhang
e30d5723e4 Merge "Add support for MTP perceived device type property." am: b6ed343e85 am: 7644b885c7
am: 136f37b88f

Change-Id: I446cd52e5fd8cda48e9af46ee3faee5578cae286
2017-03-20 21:54:28 +00:00
Ray Essick
5204ad0a2a Merge "Integrate API Council feedback into Media Metrics APIs" 2017-03-16 01:02:25 +00:00
Ray Essick
f2d0e40bf0 Integrate API Council feedback into Media Metrics APIs
Integrates the API Council's feedback into the Media Metrics
related APIs.
-- return types for the getMetrics() calls
-- definition of keys in the set of data that comes back

Bug: 35811992
Test: booted, CTS subset, checked dumpsys media.metrics output
Change-Id: Ib750f9631bd3453be3132760273ccfff0a891f88
2017-03-15 11:43:08 -07:00
Paul Mclean
b8feaa5eaa Merge "Switching Native MIDI API to an "opaque pointers" model." 2017-03-11 17:49:22 +00:00
Paul McLean
71f672b98a Switching Native MIDI API to an "opaque pointers" model.
Test: manual

Change-Id: Ic181008427e6e81106d867cc3a70deef8c591841
2017-03-10 15:54:16 -07:00
Robert Shih
252f3b20bb JNI ImageReader: propagate exceptions when creating surface planes
Bug: 36082388
Test: Manual
Change-Id: I4a0ad08c9b3c53aa7ca702e1c6e2d486b788f3ff
2017-03-10 18:18:00 +00:00
Andy Hung
d4f1e86190 VolumeShaper: Update Builder methods and Object overrides
Builder methods now throw IllegalArgumentExceptions on invalid
conditions.

Object hashCode, toString, equals updated for element-wise structural
equivalence.

Test: CTS VolumeShaperTest
Bug: 31015569
Change-Id: I02860a51da58d8207145a9b8a5d2cb13806774b4
2017-03-08 10:52:26 -08:00
TreeHugger Robot
227bdecf02 Merge "fallout of cleaning-up libutils includes" 2017-03-04 00:52:50 +00:00
Mathias Agopian
df7707cb4f fallout of cleaning-up libutils includes
Test: run & compile
Bug: n/a
Change-Id: I0f6a0be03f4b120b1b5876aae0c0618c025d9f2b
2017-03-03 12:37:54 -08:00
Mikhail Naganov
c276c59eb5 nativemidi: Prototype demonstrating native access to IMidiDeviceServer
Framework changes and a demo app
Comment and finalized Native MIDI API
Replaced fixed PortRegistry tables with std::map.
more error handling.
Removed not-very-useful MidiDeviceManager class.
Made Java API functions @hide.

Bug: 30252756

Test: Manual
Change-Id: Iae98e589f38ef6d625ff0842401193fe98c5d881
2017-03-03 12:00:33 -07:00
Chong Zhang
d5927ae883 MediaCas: add framework APIs
Java API changes to support MediaCas framework.

Also add partial-frame related enums to MediaCodec,
MediaCodecInfo, and MediaExtractor as a way to indicate
a input frame contains partial data.

Test: basic test app and test plugin to execise the code path;
impelenting playback of CAS-secured MPEG2TS streams, including
a Widevine-based CAS plugin, locally modified ExoPlayer and
Android TV Tuner input.

bug: 22804304
Change-Id: Ia4ba1d4046f7588e42bfb21e726390457d2fc8e3
2017-02-22 17:27:01 -08:00
Ray Essick
8020105fb2 Merge "Metrics for android.media.MediaRecorder" 2017-02-17 22:39:40 +00:00
Hassan Shojania
06b25fb236 Modular DRM for MediaPlayer
Bug:  34559906
Test: Manual through the test app
Change-Id: I1b1ca61e74f250d63ff5ff462905facb81fe44e0
2017-02-15 18:44:54 -08:00
Ray Essick
b0bd62f96c Metrics for android.media.MediaRecorder
Implementation of getMetrics() API and underlying metrics gathering
for android.media.MediaRecorder.

Bug: 35150984
Test: hacked CTS, observing of 'dumpsys media.metrics'
2017-02-12 19:22:48 -08:00
Andy Hung
035d4ec772 VolumeShaper: Initial implementation
The VolumeShaper is used to apply a volume
envelope to an AudioTrack or a MediaPlayer.

Test: CTS
Bug: 30920125
Bug: 31015569
Change-Id: If8b4bed29760aa3bd15a4b54cae60e40b4f518ee
2017-02-10 18:08:12 -08:00
Ray Essick
ba5ce2c0f8 API android.media.MediaExtractor.getMetrics()
adds the API getMetrics() to android.media.MediaExtractor
includes plumbing through JNI to the underlying mediaextractor
code in frameworks/av.

Tested with some CTS modifications; a more formal set of CTS
updates will be along later.

Bug: 35094936
Test: modified CTS to invoke new API and output results
Change-Id: Id8d56c9c3273b86bbd11e248bdf5004be90b91ef
2017-02-07 15:35:39 -08:00
Edwin Wong
e9b8348027 Merge "Pass application packagename to drm plugin." 2017-01-31 05:03:44 +00:00
Hassan Shojania
0b52e95c3f Modular DRM for MediaPlayer
Bug:  34559906
Test: Manual through the test app

Change-Id: If76e2898e6064c5661193872b907b1720838c678
2017-01-27 19:03:09 -08:00
Ray Essick
0e0fee1e3a API access to mediametrics
provide SDK/API access to media metrics for user apps. This lets the
apps metrics data for their instances of player and codecs. Others
to come.

Bug: 34715803
Test: booted, invoked new APIs to verify desired results
Change-Id: Iaae6406aadef30adc893952961ac154a7c4c761d
2017-01-27 17:58:30 +00:00
TreeHugger Robot
60d820b050 Merge "media: Add new MediaMuxer constructor that takes FileDescriptor." 2017-01-26 08:22:01 +00:00
Hangyu Kuang
61c74c6a4b media: Add new MediaMuxer constructor that takes FileDescriptor.
Test: Run new mediamuxer CTS test.
Bug: 34221063
Change-Id: Iaad4f0254782dca3e5994e80af0848482847c618
2017-01-25 18:31:02 -08:00
Wei Jia
23dfee521a mediaplayer: add buffering settings API
Test: compiles, ensured that params is passed all the way to source
Bug:32524218

Change-Id: I90d65e10012ecc1a78989eba80d025d513ceaadf
2017-01-25 11:54:56 -08:00
Jerry Zhang
13bb2f4dda Add support for MTP perceived device type property.
Property value is based on the particular device.
This allows some hosts (windows) to apply a device
specific icon in file explorer.

Test: Connect device to windows, verify new icon
Bug: 25360563
Change-Id: I9d3468ca8c01a6f0d42ad543aef11ed265b6c825
2017-01-19 11:26:35 -08:00
Hangyu Kuang
e176ee1222 media: Add new API to set next output file.
Only support recording to MP4 file now. When the recorded file is approcaching
file size limit, application will receive
MEDIA_RECORDER_INFO_MAX_FILESIZE_APPROACHING callback from mediarecorder.
Application could use setNextOutputFile to set the next output file before or
after receiving this callback. Upon reaching filesize limit, recorder will swap
the output file internally and notify application with
MEDIA_RECORDER_INFO_NEXT_OUTPUT_FILE_STARTED.

Test: Hack camera app to record more than filesize limit.
Bug: 28150626
Change-Id: I2daf8f798fe3631d6b7ef48ebea3a64ab4566f2d
2017-01-18 17:32:17 -08:00
Edwin Wong
4d1d84e8a0 Pass application packagename to drm plugin.
Get the application packagename to be used as part of a unique
identifier for drm plugin.

Test: Stream movies through Play Movies, Netflix and
Gts MediaCodecCencPlayer tests.
Verify the application's packagename is reachable in the drm plugin's
debug log.

bug: 27101531

Change-Id: I6473b58d78bc34191aca5896bb1f5fb79107ae47
2017-01-07 23:59:40 -08:00
Alex Klyubin
f271c6d266 resolve merge conflicts of b53d984 to master
Change-Id: I3fe63a5c0193c720b8ec4ca53834096de8433f26
2016-12-22 12:00:24 -08:00
Alex Klyubin
abdc2b47b3 Make users of MtpServer fill in DeviceInfo field values
This is part of weaning apps off accessing system identifiers via
system properties API. Apps should use android.os.Build API instead.

Bug: 33700679
Test: Enable MTP mode then check that mtp-detect output same as before this commit
Change-Id: I4e6696cdee18b9c3e987c432c095911e85a997db
2016-12-21 13:56:28 -08:00
Jerry Zhang
d9291d55f6 Merge "Modify UsbDeviceManager stack to allow MtpServer to use FunctionFS drivers." am: 1975240f17 am: 830874dbe7 am: 88672d7d29
am: 11dc0eccfb

Change-Id: Ibafebe4877052595cb34626bde9ac6fba1983fb0
2016-12-13 01:02:55 +00:00
Jerry Zhang
bb598ee16f Modify UsbDeviceManager stack to allow MtpServer to use FunctionFS drivers.
Functionfs requires MtpServer to write descriptors before the device can be
configured. This adds a new configure call that will occur only when
functions are changed (new argument added to updateUsbStateBroadcast for this)
and be called after sys.usb.config is changed but before the waitForState
call to ensure compatibility with configfs devices.

Bug: 30976142
Change-Id: I7e94a5847d3b19c0fd75139e1b15a3f2a1cea01d
Test: Manual
2016-12-12 11:05:32 -08:00
Wei Jia
400752a790 Merge "MediaPlayer: enable same seek modes as in MediaMetadataRetriever." 2016-12-01 22:08:11 +00:00
Wei Jia
ebc2b694d1 MediaPlayer: enable same seek modes as in MediaMetadataRetriever.
Test: manually check result of mediaplayer.seekTo
Bug: 32557491
Change-Id: Ib507fbfb86a24fcf9b42758e89e595a4a58d33b5
2016-12-01 12:32:34 -08:00
Marco Nelissen
7e5e1b0d72 No need to initialize the file sniffers anymore
Bug: 33166870

Change-Id: I9f944fcb7d63ca4eb31aec5e7e97e3e0e499cc39
2016-11-28 19:05:32 +00:00
Jean-Michel Trivi
8e48c6939b Refactor SoundPool for appOps handling through PlayerBase
Modified the signature of the abstract volume methods so
  it is clear at the subclass level whether the volume
  command is for a mute or a volume control.
  Changed the implementations in the subclasses
  accordingly.
Removed appOps handling inside SoundPool and made it
  inherit from PlayerBase.
Moved handling of the camera sound restriction from
  SoundPool to PlayerBase.
Added support in SoundPool native implementation for
  muting, as each player has its own volume.

Test: play a long file with SoundPool and enter DnD mode

Bug: 30955183
Bug: 28249605

Change-Id: I0fcd7480f9a455c06aa4f7092486f5c65bc9d7db
2016-11-14 09:36:11 -08:00
Marco Nelissen
618c1a9ae6 Merge "Make AmrInputStream use MediaCodec"
am: 866658261f

Change-Id: Id25833efb8baa54e729bdc823e5849819c53cd64
2016-11-11 20:10:00 +00:00
Marco Nelissen
01d023e966 Make AmrInputStream use MediaCodec
Bug: 32114618
Test: ran CTS test
Change-Id: I9fe77689bf0bcd1bc8f6c5a4d62135271c7bef8b
2016-11-11 10:53:09 -08:00
Marco Nelissen
2a6aae0857 Drm APIs are in libmediadrm instead of libmedia
Test: build/boot
Change-Id: I4a6929d2d524d5f2f7ffa06f68a3c1041804e125
2016-11-07 16:37:06 -08:00
Marco Nelissen
1d10b88f40 Merge "Use libaudioclient"
am: 0a05c49248

Change-Id: I134c9c5b95e446fcc18e2b35a3eca2a4a794e8c8
2016-11-07 17:22:36 +00:00
Marco Nelissen
74abdda6a0 Use libaudioclient
Test: build/boot
Change-Id: I7c730bfd47297f311e00798b5927888ddc3f5062
2016-11-04 19:31:54 -07:00
Marco Nelissen
9a9e54cfb7 Merge "Use libaudioclient" 2016-11-04 21:53:57 +00:00
John Reck
946d11d216 Merge "Re-unite sources with their headers"
am: e43444a00b

Change-Id: I8f3ef6a1ddcf78d28f7444b6e83c552b8305fd8c
2016-11-04 21:47:34 +00:00
John Reck
03b5d506bc Re-unite sources with their headers
Move all the includes for androidfw under
a common base path for that library instead
of frameworks/base/includes.

Also fixes -Werror issues that resulted in
no longer being -isystem.

Test: builds
Change-Id: Ic4312eb61b197af114dded5691d5ae1ec82923f7
Merged-In: Ic4312eb61b197af114dded5691d5ae1ec82923f7
(cherry picked from commit f6113af2d6f6eebee68d3ac510fe96d38a7a39e9)
2016-11-04 13:27:37 -07:00
John Reck
f6113af2d6 Re-unite sources with their headers
Move all the includes for androidfw under
a common base path for that library instead
of frameworks/base/includes.

Also fixes -Werror issues that resulted in
no longer being -isystem.

Test: builds
Change-Id: Ic4312eb61b197af114dded5691d5ae1ec82923f7
2016-11-03 16:26:59 -07:00
Marco Nelissen
20edcbc89c Use libaudioclient
Test: build/boot
Change-Id: I7c730bfd47297f311e00798b5927888ddc3f5062
2016-11-03 10:58:33 -07:00
Marco Nelissen
b3a22bcb76 Remove unneeded libraries from libmedia_jni
Test: built and booted
Change-Id: I9bd8dd0001688eabc0d58563b652eb11a69efba8
2016-10-26 21:20:49 +00:00