8219 Commits

Author SHA1 Message Date
Dongwon Kang
eea9743ba5 TIF: introduce TvContract.buildChannelUriForPassthroughTvInput()
This change adds a way to get a dummy channel for starting pass-through
TV inputs which don't have real channels in TvProvider.
Bug: 15496325

Change-Id: I7a6b99964319f12a0f8692b4e307e03480119a69
2014-07-18 16:24:57 +09:00
Jae Seo
874f95ca73 Merge "TIF: Add TvInputInfo.getParentId" into lmp-dev 2014-07-17 16:16:48 +00:00
Ji-Hwan Lee
66bdf247df TIF: Add TvInputInfo.getParentId
Bug: 16166859
Change-Id: I07130b6f974ca7b2527aba68b92dc31fb4b5a139
2014-07-17 14:40:31 +09:00
Chulwoo Lee
5130655bcb Merge "Pass input ID to the setup/settings activity" into lmp-dev 2014-07-17 04:18:22 +00:00
Chulwoo Lee
3b2f507910 Merge "Introduce "input_id" column to the channels table" into lmp-dev 2014-07-17 04:15:25 +00:00
Jungshik Jang
12307ca810 Revisit HDMI-CEC system audio mode in AudioService.
From recent feedback on HDMI-CEC system audio mode,
it would be unnecessary to enforce output from AudioService.
Instead, it would follow audio policy according to status
of HDMI-CEC system audio mode.
For that removed two params of setHdmiSystemAudioModeSupported
api of AudioManager.

In terms of speaker mute, it will be handled by removing speaker
from audio ouput instead of changing gain control. For that
added new force usage type, FOR_HDMI_SYSTEM_AUDIO_MODE and
new force config type, FORCE_HDMI_SYSTEM_AUDIO_ENFORCED.
This is used to notify change of system audio mode to
audio policy manager.

Bug: 16305986
Bug: 16002150

Change-Id: I5643ad093a651c951e12b567c6e11b88aa87cea2
2014-07-17 09:27:25 +09:00
Robert Shih
c20533c1a7 MediaRecorder: added constants for WEBM output
Change-Id: Iacbb55bda71bb6da98244255bf2a4c34c7342fb0
2014-07-16 16:06:21 -07:00
Chulwoo Lee
d0d02e22ce Introduce "input_id" column to the channels table
Until now, TvInputService has been providing the channels. But from now
on, a TvInputService can have several TV inputs and the TV input will
provide its channels.
So introduced "input_id" which is the ID of the TV input instead of
"service_name" which designates the TvInputService.
Also updated related APIs.

BUG: 16138420
Change-Id: I1d4dcad17c028384ab75a7f71ee0b305509ae952
2014-07-16 12:19:03 +00:00
Chulwoo Lee
029179d7f9 Pass input ID to the setup/settings activity
In the setup/setting phase, the activities should know their input ID
to access the channels/programs table.

Change-Id: If7afcb0ea474dca08c3dee06cbfcf76191a68660
2014-07-16 20:26:12 +09:00
Lajos Molnar
1e6e8018a4 MediaCodec: add reset() + documentation fixes
Bug: 12034929
Change-Id: I38f89a2e4c41e0ceb3fdae4522b9c04f6c43a4f1
2014-07-15 18:14:04 -07:00
Liejun Tao
f4e51d82d2 AudioService: Use device specific mode to open SCO audio
Bluetooth carkit may need specific mode to open SCO
channel. Add a settings value using BT device's MAC address
to store the SCO mode and use it to open SCO. In case no value
is stored, use default mode: Virtual Voice Call.

Change-Id: Iea31a48be0e8f3bd2d8689635fd8ce6f6d6da15a
2014-07-16 15:50:54 -07:00
RoboErik
ac17c2a8c9 Merge "Change adjustVolumeBy to adjustVolume" into lmp-dev 2014-07-16 16:25:13 +00:00
RoboErik
1ff5b1648a Change adjustVolumeBy to adjustVolume
This makes volume adjustments take a direction instead of a number of
steps and renames the API appropriately.

Change-Id: I6a31cbc42d889a38aa63446686a424cb2b8b2270
2014-07-16 12:03:45 -07:00
RoboErik
8b4bffcac9 Make MediaSession and MediaController constructors public
This makes the MediaSession/Controller constructors public and registers
with the system behind the scenes.

This also adds a bit about needing to call setActive(true) to start receiving
commands in MediaSession's docs.

Change-Id: If882d229b54c36bf0831aca0255052dda667a2bc
2014-07-16 12:03:45 -07:00
RoboErik
71940885f2 Merge "Make MediaSession and MediaController constructors public" into lmp-dev 2014-07-16 13:12:22 +00:00
Jean-Michel Trivi
d70ad7a128 MediaPlayer factory method with audio attributes and session ID
Change-Id: I4e7f633c84c90581e849af2865f5be84a026f32f
2014-07-16 18:36:20 +00:00
Jae Seo
54892c8b81 Merge "Implement TvContentRating" into lmp-dev 2014-07-15 20:35:01 +00:00
Sungsoo Lim
e16873467c Implement TvContentRating
Added a class that represents TV content ratings that are used for
parental controls. TV input services are required to create
TvContentRating objects with rating/sub-rating constants for specific
countries (for now US and KR only) defined in this class and then
convert them into strings in order to store them in the EPG database.

Bug: 13172379
Change-Id: I6200cb12fbc274dd0a8bcb87a8ac3cd2d96791db
2014-07-15 22:11:21 -07:00
Jean-Michel Trivi
79f5cd1429 Unhide MediaPlayer.setAudioAttributes(), javadoc clarifications
Unhide MediaPlayer.setAudioAttributes() method.

Update javadoc to explicitly state that the factory methods
  do not let you set the audio stream type, attributes or session.

Change-Id: I0d097c314db010698b035349befe0659ab4d1dde
2014-07-16 14:41:06 +00:00
Jean-Michel Trivi
d2bebb3ab8 DO NOT MERGE Audio virtualizer effect: add support for querying capabilities
Change-Id: Ib62bab6655996575d7703be0bcb55fa8559a68a2
(cherry picked from commit 57fa19dec7150678020e7f1fe6e6879fd9d873f5)
2014-07-15 15:45:16 +00:00
Wonsik Kim
969167dc05 TIF: Revisit availability changes
Bug: 15838097, Bug: 15973274
Change-Id: Ida060696cb6222c8ced576d86c100c25d94dc5c0
2014-07-15 02:58:33 +00:00
Lajos Molnar
7be24522ce MediaExtractor: set buffer offset/limit in readSampleData
also fix setting offset/limit in MediaCodec's getBuffer.

Bug: 13008204
Change-Id: Iadf0f006cfccc2546971cc5384058e1a2721780b
2014-07-15 02:30:32 +00:00
Eino-Ville Talvala
6dc599b995 Merge "MediaRecorder: Fix crash when given a released Camera object" into lmp-dev 2014-07-14 18:37:56 +00:00
Eino-Ville Talvala
6a5b1db177 MediaRecorder: Fix crash when given a released Camera object
Bug: 15617637
Change-Id: I420ecc3f7b946dcf705cf210a7d493290f838f09
2014-07-14 12:02:21 -07:00
RoboErik
44583d351e Merge changes I51f2e466,I5b67cb3e into lmp-dev
* changes:
  Make PlaybackState immutable with a builder
  Add API to set a default session in Activity
2014-07-14 18:37:56 +00:00
RoboErik
c785a78fb4 Make PlaybackState immutable with a builder
bug:15862252
Change-Id: I51f2e466bd2c41bbe80d20aa9785126a7ac6ab3f
2014-07-14 13:40:43 -07:00
John Spurlock
33f4e04e32 Volume: Delay adjustments made when showing ringer UI.
Since the volume rocker is now the primary system UI for
entering ringer modes, we need to provide a way to display
the ui without making a sound.

Change the policy for the ringer stream to only display the
UI on the initial adjustment request, don't actually make
an adjustment.  However, don't break previous ability to
press and hold the vol keys down to vibrate, so allow this
after the standard framework long-press delay.

Audio service had no way of knowing whether or not the registered
volume controller was visible, so add a mechanism for the
controller (volume panel) to send that info back to the service.

Found and fixed a discrepancy between AudioManager.handleKeyDown
and MediaSessionLegacyHelper so that an adjustment over the
keyguard is allowed to vibrate as well as play sound during
adjustments.

Bug:16202639
Change-Id: Icd36c23e8d08c4ed57922c05724b281f32049be7
2014-07-14 16:49:34 +00:00
Jeff Brown
1a937b04e6 Initial draft of new MediaRouter APIs.
This patch introduces basic infrastructure for the new MediaRouter
API.  The code is fully documented but incompletely implemented.
It is being submitted not to facilitate API reviews.

MediaRouter is a new class that applications used to discovery,
connect to, and control media devices as represented by media
destinations and their routes.  Routes may offer a variety of
capabilities.  This new class is a much more powerful replacement
for the existing MediaRouter.

MediaRouteService is a base class for creating media route services
which third-parties can implement to make routes available to
applications.  It is analoguous to the MediaRouteProvider
infrastructure of the old media router support library but it
is designed to be integrated into the framework and enable a
variety of new usages such as remote display projection.

Stay tuned for more...

Change-Id: I2c7c6013d9f751d71e83697e7fc9e49bf7751fef
2014-07-14 04:38:14 -07:00
Jeff Brown
01a500ed1c Delete first draft of media routing APIs.
The new APIs will not be as tightly integrated into MediaSession.

Change-Id: I5cfd37d9d8d0c5d46c55edb5cf0772a8f1ef13ab
2014-07-14 04:06:44 -07:00
Eino-Ville Talvala
b942b05093 Deprecate android.hardware.Camera
__
             ||
             ||
             ||
             ||---____-----+
             ||    \_/     |
             ||   /. .\    |
             ||  ||---||   |
             ||   |___|    |
             ||    | |     |
             ||---____-----+
             ||
             ||
             ||
_____________||_________________

Replaced by android.hardware.camera2

- Also deprecate MediaRecorder#setCamera
- Also deprecate all Camera inner classes
- Update reference documentation in various classes to point to camera2
- Add note to camera API guide that it uses the old API
  (until a new guide is available)
- Remove old hidden raw sensor format; superceded by RAW_SENSOR.

Change-Id: I3d839765fc9b9aae906751ee32d6956ef40451ce
2014-07-13 21:45:57 -07:00
Dongwon Kang
9b08edff23 do not merge. Implement onVideoAvailable/Unavailable in TIF.
Use cases:
  - VIDEO_UNAVAILABLE_REASON_TUNE: to show spinner on channel change.
  - VIDEO_UNAVAILABLE_REASON_WEAK_SIGNAL: to show a message and spinner on weak TV signal.
  - VIDEO_UNAVAILABLE_REASON_BUFFERING: to show spinner on buffering.
  - VIDEO_UNAVAILABLE_REASON_UNKNOWN: to show spinner.

Bug: 14126559
Change-Id: Ide2b68c74bd96d4ea1b9d85ab099a277253d05c7
(cherry picked from commit 1edfd8eb985ee41095c60f4aaf7029f56abff614)
2014-07-14 01:00:53 +00:00
Jae Seo
2c1c31c7ae TIF: Add a way to enable/disable caption
This is required to handle the case that an application wants to turn
on/off the caption explicitly (e.g. TvView in PIP). TV input service
implementation must respond to the request immediately to avoid any
legal implication since the captioning is imposed by the law in many
countries.

Bug: 14121898
Change-Id: I9600debae709fdc99065d7a0138ae69d1dffc9ba
2014-07-12 20:43:11 -07:00
Naveen Kumar Ponnusamy
ee64575cf7 Added a test for HEVC playback memory usage
Bug: 14571712
Change-Id: If5c4053dea23142b73aed77498c93e149b7ef9b2
2014-07-12 22:13:32 +00:00
Lajos Molnar
b1a236b85f add utility methods to util.Range, Rational and Size
Bug: 12065651
Bug: 11990470
Change-Id: I0d0929ea0289ac5de5c17cca90f25abc4e9dfd7a
2014-07-12 14:12:27 -07:00
Robert Shih
f79c22eb2c Merge "MediaRecorder: use fd from RandomAccessFile" 2014-07-11 23:25:18 +00:00
Robert Shih
0d5d3b7cc8 MediaRecorder: use fd from RandomAccessFile
Use RandomAccessFile instead of FileOutputStream so the underlying fd
is opened O_RDWR; O_RDWR is needed for mmap calls in the native webm
writer.

Change-Id: I444cbf40add96bc05905369ae2fa2b5446b0f9cc
2014-07-10 17:06:33 -07:00
Robert Shih
bef45561b0 Merge "MediaPlayer: added getSelectedTrack" 2014-07-10 20:49:26 +00:00
Chong Zhang
94686d13ca MediaCodec: change onError cb to send CodecException
Bug: 11990118
Change-Id: I8b6112f126c2f473f64e2aad6ffcfbc3f1d6e64a
2014-07-11 19:42:55 -07:00
Lajos Molnar
d4023114e8 MediaCodec: add new buffer and format APIs
Bug: 14562236
Bug: 14297827
Bug: 13008204
Bug: 10706245
Bug: 10672559
Bug: 9175531

Change-Id: Ia94d34f625e532619a9ed344eb27e0d26647982f
2014-07-12 01:43:56 +00:00
Robert Shih
464da703ca MediaPlayer: added getSelectedTrack
Change-Id: Ic39b9b3d5e72e13452320a0272deb489a0285913
2014-07-10 20:32:37 -07:00
Lajos Molnar
60fde9d254 media: add crop rectangle to Image
Bug: 10706245
Change-Id: I9c9150bdef418fd96228addaa7c35f16e5e1ccff
2014-07-12 01:04:03 +00:00
Lajos Molnar
82fa0e7f78 MediaCodec: update documentation on buffer metadata.
- Deprecated BUFFER_FLAG_SYNC_FRAME (as it actually marks key
  frames).
- Clarified that BUFFER_FLAG_KEY_FRAME is used for encoded output
  buffers.
- Clarified that presentationTimeUs is not an actual render
  timestamp (as opposed to releaseOutputBuffer's render timestamp).

Bug: 12006531
Change-Id: Ia27b9f606a9d7eef9c0c2900cd864a4421c7cf31
2014-07-11 15:43:36 -07:00
Chong Zhang
8d5e556b2b MediaCodec async callbacks
Bug: 11990118

Change-Id: I210d4302e1fd7e1a48d2228fd3f4f20c16b18a75
2014-07-11 11:53:03 -07:00
Jean-Michel Trivi
998ff75484 fix build: hide AudioAttributes.usageToString() method
Change-Id: I1041d9bf530df45878dd61e30e32f5a2f4f9d1a1
2014-07-11 10:01:00 -07:00
Jean-Michel Trivi
a8b6bd88cf Define audio policy, mixes, and mixing rules
An AudioMixingRule is a collection of AudioAttributes and match/exclude
   rules.
An AudioMix is defined by its AudioMixingRule, AudioFormat and
   routing flag.
An AudioPolicyConfig is a collection of AudioMix and is
   parcellable.
An AudioPolicy has an AudioPolicyConfig, and
   can be registered/unregistered through AudioManager.

bug 16009464

Change-Id: I01bf95d014967f48ba823648ea897779da099e5d
2014-07-11 09:10:46 -07:00
Dongwon Kang
1f213914c4 Support multiple tracks in TV Input framework.
Added API: getTracks/selectTrack/unselectTrack/onTrackInfoChanged
(onVideo/Audio/ClosedCaptionStreamChanged callbacks are removed in favor of onTrackInfoChanged)
Use cases: audio and closed caption track selection
Background: go/tif-multi-track

Bug:14073704, Bug:14121898, Bug: 16049453
Change-Id: I199ed16f690d4e757da0bb30c8bc8222a6fa1d7a
2014-07-11 18:46:25 +09:00
Jungshik Jang
6f34f5ab8a Revamp HDMI-CEC system audio mode integration with audio service.
In previous change we use setForceUse(FORCE_MEDIA, XXX) method
in order to set specific audio output type, such as LINE, HDMI_ARC,
and SPDIF. But it turns out that it conflicts with bluetooth
a2dp which uses the same setForceUse(FORCE_MEDIA, yyy).

This change is based on several conditions.

1. When other non-speaker devices are on, prevent system audio
   from turing on.
2. In order to keep track of other devices' connectivity and to
   turn off system audio if other device like bluetooth or
   headphone preempts current output, register OnAudioPortChangeListner
   to audio manager.
3. All possible system audio outputs can be merged with other
   outputs without priority.

Change-Id: Id4e47d99db64b9f77a17c2c28c47787ab8980bf7
2014-07-11 08:07:12 +09:00
Erik Pasternak
b2e93efcac Revert "Make PlaybackState immutable with a builder"
Will resubmit tomorrow for Build Breakage Friday as this change needs new SDK prebuilts for unbundled app branches.

This reverts commit aa746b27610680a2c0fbdf7d81a6455c4597f05e.

Change-Id: I28ba7e1b09234a5eb1b725aed043b9de98e1bc16
2014-07-10 22:51:34 +00:00
RoboErik
5a4e011143 Make PlaybackState immutable with a builder
bug:15862252
Change-Id: I8944b7753cd6a36a74b0091f71a386f77040c4ab
2014-07-10 22:39:03 +00:00
John Spurlock
cd22c3ec53 Merge "Volume: allow dialog to play sound over keyguard." 2014-07-10 00:46:47 +00:00