1 /**
2  * Copyright (c) 2019, The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.media;
18 
19 import android.media.ITranscodingClient;
20 import android.media.ITranscodingClientCallback;
21 import android.media.TranscodingSessionParcel;
22 import android.media.TranscodingRequestParcel;
23 
24 /**
25  * Binder interface for MediaTranscodingService.
26  *
27  * {@hide}
28  */
29 interface IMediaTranscodingService {
30     /**
31      * All MediaTranscoding service and device Binder calls may return a
32      * ServiceSpecificException with the following error codes
33      */
34     const int ERROR_PERMISSION_DENIED = 1;
35     const int ERROR_ALREADY_EXISTS = 2;
36     const int ERROR_ILLEGAL_ARGUMENT = 3;
37     const int ERROR_DISCONNECTED = 4;
38     const int ERROR_TIMED_OUT = 5;
39     const int ERROR_DISABLED = 6;
40     const int ERROR_INVALID_OPERATION = 7;
41 
42     /**
43      * Default UID/PID values for non-privileged callers of
44      * registerClient().
45      */
46     const int USE_CALLING_UID = -1;
47     const int USE_CALLING_PID = -1;
48 
49     /**
50      * Register the client with the MediaTranscodingService.
51      *
52      * Client must call this function to register itself with the service in
53      * order to perform transcoding tasks. This function will return an
54      * ITranscodingClient interface object. The client should save and use it
55      * for all future transactions with the service.
56      *
57      * @param callback client interface for the MediaTranscodingService to call
58      *        the client.
59      * @param clientName name of the client.
60      * @param opPackageName op package name of the client.
61      * @return an ITranscodingClient interface object, with nullptr indicating
62      *         failure to register.
63      */
registerClient( in ITranscodingClientCallback callback, in String clientName, in String opPackageName)64     ITranscodingClient registerClient(
65             in ITranscodingClientCallback callback,
66             in String clientName,
67             in String opPackageName);
68 
69     /**
70     * Returns the number of clients. This is used for debugging.
71     */
getNumOfClients()72     int getNumOfClients();
73 }
74