Loading media/libstagefright/codec2/include/C2Param.h +27 −1 Original line number Diff line number Diff line Loading @@ -933,6 +933,7 @@ public: \ enum : uint32_t { baseIndex = kParamIndex##name | C2Param::BaseIndex::_kFlexibleFlag }; \ DEFINE_C2STRUCT_NO_BASE(name) #ifdef __C2_GENERATE_GLOBAL_VARS__ /// \ingroup internal /// Describe a structure of a templated structure. #define DESCRIBE_TEMPLATED_C2STRUCT(strukt, list) \ Loading @@ -943,6 +944,12 @@ public: \ /// Describe the fields of a structure using an initializer list. #define DESCRIBE_C2STRUCT(name, list) \ const std::initializer_list<const C2FieldDescriptor> C2##name##Struct::fieldList = list; #else /// \if 0 #define DESCRIBE_TEMPLATED_C2STRUCT(strukt, list) #define DESCRIBE_C2STRUCT(name, list) /// \endif #endif /** * Describe a field of a structure. Loading Loading @@ -1022,6 +1029,7 @@ public: \ * ~~~~~~~~~~~~~ * */ #ifdef __C2_GENERATE_GLOBAL_VARS__ #define C2FIELD(member, name) \ C2FieldDescriptor(&((_type*)(nullptr))->member, name), Loading @@ -1040,6 +1048,24 @@ public: \ #define DEFINE_AND_DESCRIBE_FLEX_C2STRUCT(name, flexMember) \ DEFINE_FLEX_C2STRUCT(name, flexMember) } C2_PACK; \ const std::initializer_list<const C2FieldDescriptor> C2##name##Struct::fieldList = { #else /// \if 0 /* Alternate declaration of field definitions in case no field list is to be generated. TRICKY: use namespace declaration to handle closing bracket that is normally after these macros. */ #define C2FIELD(member, name) /// \deprecated #define C2SOLE_FIELD(member, name) /// Define a structure with matching baseIndex and start describing its fields. /// This must be at the end of the structure definition. #define DEFINE_AND_DESCRIBE_C2STRUCT(name) \ DEFINE_C2STRUCT(name) } C2_PACK; namespace ignored { /// Define a flexible structure with matching baseIndex and start describing its fields. /// This must be at the end of the structure definition. #define DEFINE_AND_DESCRIBE_FLEX_C2STRUCT(name, flexMember) \ DEFINE_FLEX_C2STRUCT(name, flexMember) } C2_PACK; namespace ignored { /// \endif #endif /** * Parameter reflector class. Loading media/libstagefright/codec2/tests/C2Param_test.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <gtest/gtest.h> #define __C2_GENERATE_GLOBAL_VARS__ #include <util/C2ParamUtils.h> #include <C2ParamDef.h> Loading media/libstagefright/codec2/vndk/Android.bp +4 −1 Original line number Diff line number Diff line cc_library_static { name: "libstagefright_codec2_vndk", srcs: ["C2Buffer.cpp"], srcs: [ "C2Buffer.cpp", "C2Config.cpp", ], include_dirs: [ "frameworks/av/media/libstagefright/codec2/include", Loading media/libstagefright/codec2/vndk/C2Config.cpp 0 → 100644 +24 −0 Original line number Diff line number Diff line /* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ //#define LOG_NDEBUG 0 #define LOG_TAG "C2Config" /** * Define and initialize global config field descriptors in this cpp file */ #define __C2_GENERATE_GLOBAL_VARS__ #include <C2Config.h> Loading
media/libstagefright/codec2/include/C2Param.h +27 −1 Original line number Diff line number Diff line Loading @@ -933,6 +933,7 @@ public: \ enum : uint32_t { baseIndex = kParamIndex##name | C2Param::BaseIndex::_kFlexibleFlag }; \ DEFINE_C2STRUCT_NO_BASE(name) #ifdef __C2_GENERATE_GLOBAL_VARS__ /// \ingroup internal /// Describe a structure of a templated structure. #define DESCRIBE_TEMPLATED_C2STRUCT(strukt, list) \ Loading @@ -943,6 +944,12 @@ public: \ /// Describe the fields of a structure using an initializer list. #define DESCRIBE_C2STRUCT(name, list) \ const std::initializer_list<const C2FieldDescriptor> C2##name##Struct::fieldList = list; #else /// \if 0 #define DESCRIBE_TEMPLATED_C2STRUCT(strukt, list) #define DESCRIBE_C2STRUCT(name, list) /// \endif #endif /** * Describe a field of a structure. Loading Loading @@ -1022,6 +1029,7 @@ public: \ * ~~~~~~~~~~~~~ * */ #ifdef __C2_GENERATE_GLOBAL_VARS__ #define C2FIELD(member, name) \ C2FieldDescriptor(&((_type*)(nullptr))->member, name), Loading @@ -1040,6 +1048,24 @@ public: \ #define DEFINE_AND_DESCRIBE_FLEX_C2STRUCT(name, flexMember) \ DEFINE_FLEX_C2STRUCT(name, flexMember) } C2_PACK; \ const std::initializer_list<const C2FieldDescriptor> C2##name##Struct::fieldList = { #else /// \if 0 /* Alternate declaration of field definitions in case no field list is to be generated. TRICKY: use namespace declaration to handle closing bracket that is normally after these macros. */ #define C2FIELD(member, name) /// \deprecated #define C2SOLE_FIELD(member, name) /// Define a structure with matching baseIndex and start describing its fields. /// This must be at the end of the structure definition. #define DEFINE_AND_DESCRIBE_C2STRUCT(name) \ DEFINE_C2STRUCT(name) } C2_PACK; namespace ignored { /// Define a flexible structure with matching baseIndex and start describing its fields. /// This must be at the end of the structure definition. #define DEFINE_AND_DESCRIBE_FLEX_C2STRUCT(name, flexMember) \ DEFINE_FLEX_C2STRUCT(name, flexMember) } C2_PACK; namespace ignored { /// \endif #endif /** * Parameter reflector class. Loading
media/libstagefright/codec2/tests/C2Param_test.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <gtest/gtest.h> #define __C2_GENERATE_GLOBAL_VARS__ #include <util/C2ParamUtils.h> #include <C2ParamDef.h> Loading
media/libstagefright/codec2/vndk/Android.bp +4 −1 Original line number Diff line number Diff line cc_library_static { name: "libstagefright_codec2_vndk", srcs: ["C2Buffer.cpp"], srcs: [ "C2Buffer.cpp", "C2Config.cpp", ], include_dirs: [ "frameworks/av/media/libstagefright/codec2/include", Loading
media/libstagefright/codec2/vndk/C2Config.cpp 0 → 100644 +24 −0 Original line number Diff line number Diff line /* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ //#define LOG_NDEBUG 0 #define LOG_TAG "C2Config" /** * Define and initialize global config field descriptors in this cpp file */ #define __C2_GENERATE_GLOBAL_VARS__ #include <C2Config.h>