• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2018 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 //#define LOG_NDEBUG 0
18 #define LOG_TAG "C2SoftwareCodecServiceRegistrant"
19 
20 #include <C2PlatformSupport.h>
21 #include <codec2/hidl/1.0/ComponentStore.h>
22 #include <media/CodecServiceRegistrant.h>
23 #include <log/log.h>
24 
RegisterCodecServices()25 extern "C" void RegisterCodecServices() {
26     using namespace ::hardware::google::media::c2::V1_0;
27     android::sp<IComponentStore> store =
28         new utils::ComponentStore(
29                 android::GetCodec2PlatformComponentStore());
30     if (store == nullptr) {
31         ALOGE("Cannot create Codec2's IComponentStore software service.");
32     } else {
33         if (store->registerAsService("software") != android::OK) {
34             ALOGE("Cannot register Codec2's "
35                     "IComponentStore software service.");
36         } else {
37             ALOGI("Codec2's IComponentStore software service created.");
38         }
39     }
40 }
41 
42