-Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
-\r
- Apache License\r
- Version 2.0, January 2004\r
- http://www.apache.org/licenses/\r
-\r
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\r
-\r
- 1. Definitions.\r
-\r
- "License" shall mean the terms and conditions for use, reproduction,\r
- and distribution as defined by Sections 1 through 9 of this document.\r
-\r
- "Licensor" shall mean the copyright owner or entity authorized by\r
- the copyright owner that is granting the License.\r
-\r
- "Legal Entity" shall mean the union of the acting entity and all\r
- other entities that control, are controlled by, or are under common\r
- control with that entity. For the purposes of this definition,\r
- "control" means (i) the power, direct or indirect, to cause the\r
- direction or management of such entity, whether by contract or\r
- otherwise, or (ii) ownership of fifty percent (50%) or more of the\r
- outstanding shares, or (iii) beneficial ownership of such entity.\r
-\r
- "You" (or "Your") shall mean an individual or Legal Entity\r
- exercising permissions granted by this License.\r
-\r
- "Source" form shall mean the preferred form for making modifications,\r
- including but not limited to software source code, documentation\r
- source, and configuration files.\r
-\r
- "Object" form shall mean any form resulting from mechanical\r
- transformation or translation of a Source form, including but\r
- not limited to compiled object code, generated documentation,\r
- and conversions to other media types.\r
-\r
- "Work" shall mean the work of authorship, whether in Source or\r
- Object form, made available under the License, as indicated by a\r
- copyright notice that is included in or attached to the work\r
- (an example is provided in the Appendix below).\r
-\r
- "Derivative Works" shall mean any work, whether in Source or Object\r
- form, that is based on (or derived from) the Work and for which the\r
- editorial revisions, annotations, elaborations, or other modifications\r
- represent, as a whole, an original work of authorship. For the purposes\r
- of this License, Derivative Works shall not include works that remain\r
- separable from, or merely link (or bind by name) to the interfaces of,\r
- the Work and Derivative Works thereof.\r
-\r
- "Contribution" shall mean any work of authorship, including\r
- the original version of the Work and any modifications or additions\r
- to that Work or Derivative Works thereof, that is intentionally\r
- submitted to Licensor for inclusion in the Work by the copyright owner\r
- or by an individual or Legal Entity authorized to submit on behalf of\r
- the copyright owner. For the purposes of this definition, "submitted"\r
- means any form of electronic, verbal, or written communication sent\r
- to the Licensor or its representatives, including but not limited to\r
- communication on electronic mailing lists, source code control systems,\r
- and issue tracking systems that are managed by, or on behalf of, the\r
- Licensor for the purpose of discussing and improving the Work, but\r
- excluding communication that is conspicuously marked or otherwise\r
- designated in writing by the copyright owner as "Not a Contribution."\r
-\r
- "Contributor" shall mean Licensor and any individual or Legal Entity\r
- on behalf of whom a Contribution has been received by Licensor and\r
- subsequently incorporated within the Work.\r
-\r
- 2. Grant of Copyright License. Subject to the terms and conditions of\r
- this License, each Contributor hereby grants to You a perpetual,\r
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
- copyright license to reproduce, prepare Derivative Works of,\r
- publicly display, publicly perform, sublicense, and distribute the\r
- Work and such Derivative Works in Source or Object form.\r
-\r
- 3. Grant of Patent License. Subject to the terms and conditions of\r
- this License, each Contributor hereby grants to You a perpetual,\r
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
- (except as stated in this section) patent license to make, have made,\r
- use, offer to sell, sell, import, and otherwise transfer the Work,\r
- where such license applies only to those patent claims licensable\r
- by such Contributor that are necessarily infringed by their\r
- Contribution(s) alone or by combination of their Contribution(s)\r
- with the Work to which such Contribution(s) was submitted. If You\r
- institute patent litigation against any entity (including a\r
- cross-claim or counterclaim in a lawsuit) alleging that the Work\r
- or a Contribution incorporated within the Work constitutes direct\r
- or contributory patent infringement, then any patent licenses\r
- granted to You under this License for that Work shall terminate\r
- as of the date such litigation is filed.\r
-\r
- 4. Redistribution. You may reproduce and distribute copies of the\r
- Work or Derivative Works thereof in any medium, with or without\r
- modifications, and in Source or Object form, provided that You\r
- meet the following conditions:\r
-\r
- (a) You must give any other recipients of the Work or\r
- Derivative Works a copy of this License; and\r
-\r
- (b) You must cause any modified files to carry prominent notices\r
- stating that You changed the files; and\r
-\r
- (c) You must retain, in the Source form of any Derivative Works\r
- that You distribute, all copyright, patent, trademark, and\r
- attribution notices from the Source form of the Work,\r
- excluding those notices that do not pertain to any part of\r
- the Derivative Works; and\r
-\r
- (d) If the Work includes a "NOTICE" text file as part of its\r
- distribution, then any Derivative Works that You distribute must\r
- include a readable copy of the attribution notices contained\r
- within such NOTICE file, excluding those notices that do not\r
- pertain to any part of the Derivative Works, in at least one\r
- of the following places: within a NOTICE text file distributed\r
- as part of the Derivative Works; within the Source form or\r
- documentation, if provided along with the Derivative Works; or,\r
- within a display generated by the Derivative Works, if and\r
- wherever such third-party notices normally appear. The contents\r
- of the NOTICE file are for informational purposes only and\r
- do not modify the License. You may add Your own attribution\r
- notices within Derivative Works that You distribute, alongside\r
- or as an addendum to the NOTICE text from the Work, provided\r
- that such additional attribution notices cannot be construed\r
- as modifying the License.\r
-\r
- You may add Your own copyright statement to Your modifications and\r
- may provide additional or different license terms and conditions\r
- for use, reproduction, or distribution of Your modifications, or\r
- for any such Derivative Works as a whole, provided Your use,\r
- reproduction, and distribution of the Work otherwise complies with\r
- the conditions stated in this License.\r
-\r
- 5. Submission of Contributions. Unless You explicitly state otherwise,\r
- any Contribution intentionally submitted for inclusion in the Work\r
- by You to the Licensor shall be under the terms and conditions of\r
- this License, without any additional terms or conditions.\r
- Notwithstanding the above, nothing herein shall supersede or modify\r
- the terms of any separate license agreement you may have executed\r
- with Licensor regarding such Contributions.\r
-\r
- 6. Trademarks. This License does not grant permission to use the trade\r
- names, trademarks, service marks, or product names of the Licensor,\r
- except as required for reasonable and customary use in describing the\r
- origin of the Work and reproducing the content of the NOTICE file.\r
-\r
- 7. Disclaimer of Warranty. Unless required by applicable law or\r
- agreed to in writing, Licensor provides the Work (and each\r
- Contributor provides its Contributions) on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\r
- implied, including, without limitation, any warranties or conditions\r
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\r
- PARTICULAR PURPOSE. You are solely responsible for determining the\r
- appropriateness of using or redistributing the Work and assume any\r
- risks associated with Your exercise of permissions under this License.\r
-\r
- 8. Limitation of Liability. In no event and under no legal theory,\r
- whether in tort (including negligence), contract, or otherwise,\r
- unless required by applicable law (such as deliberate and grossly\r
- negligent acts) or agreed to in writing, shall any Contributor be\r
- liable to You for damages, including any direct, indirect, special,\r
- incidental, or consequential damages of any character arising as a\r
- result of this License or out of the use or inability to use the\r
- Work (including but not limited to damages for loss of goodwill,\r
- work stoppage, computer failure or malfunction, or any and all\r
- other commercial damages or losses), even if such Contributor\r
- has been advised of the possibility of such damages.\r
-\r
- 9. Accepting Warranty or Additional Liability. While redistributing\r
- the Work or Derivative Works thereof, You may choose to offer,\r
- and charge a fee for, acceptance of support, warranty, indemnity,\r
- or other liability obligations and/or rights consistent with this\r
- License. However, in accepting such obligations, You may act only\r
- on Your own behalf and on Your sole responsibility, not on behalf\r
- of any other Contributor, and only if You agree to indemnify,\r
- defend, and hold each Contributor harmless for any liability\r
- incurred by, or claims asserted against, such Contributor by reason\r
- of your accepting any such warranty or additional liability.\r
-\r
- END OF TERMS AND CONDITIONS\r
-\r
- APPENDIX: How to apply the Apache License to your work.\r
-\r
- To apply the Apache License to your work, attach the following\r
- boilerplate notice, with the fields enclosed by brackets "[]"\r
- replaced with your own identifying information. (Don't include\r
- the brackets!) The text should be enclosed in the appropriate\r
- comment syntax for the file format. We also recommend that a\r
- file or class name and description of purpose be included on the\r
- same "printed page" as the copyright notice for easier\r
- identification within third-party archives.\r
-\r
- Copyright [yyyy] [name of copyright owner]\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
-\r
-\r
+Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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.
+
+
+
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#ifndef __RI_CATEGORY_TYPE_H__\r
-#define __RI_CATEGORY_TYPE_H__\r
-\r
-/**\r
- * @enum ri_rsc_category_e\r
- * @brief The id of resource category to which device belongs\r
- * Equals to device type\r
- * @version 4.0\r
- */\r
-typedef enum {\r
- RI_CATEGORY_VIDEO_ENCODER_NOT_SUPPORTED = -6, /**< Not supported video encoder, support since version 5.0 */\r
- RI_CATEGORY_IMAGE_DECODER_NOT_SUPPORTED = -5, /**< Not supported Image decoder */\r
- RI_CATEGORY_NOT_PERMITTED = -4, /**< Not permitted category by resource policy */\r
- RI_CATEGORY_MJPEG_DECODER_NOT_SUPPORTED = -3, /**< Not supported MJPEG decoder */\r
- RI_CATEGORY_JPEG_DECODER_NOT_SUPPORTED = -2, /**< Not supported JPEG decoder */\r
- RI_CATEGORY_VIDEO_DECODER_NOT_SUPPORTED = -1, /**< Not supported video decoder */\r
- RI_CATEGORY_NONE = 0, /**< no category information */\r
- RI_CATEGORY_AUDIO_DECODER = 1, /**< Audio Decoder */\r
- RI_CATEGORY_AUDIO_SPDIF_ES_OUTPUT, /**< spdif es output */\r
- RI_CATEGORY_VIDEO_DECODER, /**< Video Decoder - MFD (Multi Format Decoder), FullHD */\r
- RI_CATEGORY_DEMUX, /**< Demux */\r
- RI_CATEGORY_AUDIO_ENCODER, /**< Audio Encoder */\r
- RI_CATEGORY_VIDEO_ENCODER, /**< Video Encoder */\r
- RI_CATEGORY_SCALER, /**< Main Scaler */\r
- RI_CATEGORY_TUNER, /**< Tuner */\r
- RI_CATEGORY_AUDIO_MAIN_OUT, /**< Logical resource to manage ALSA main out source */\r
- RI_CATEGORY_AUDIO_REMOTE_OUT, /**< Logical resource to manage ALSA remote out source */\r
- RI_CATEGORY_AUDIO_SCART_OUT, /**< Logical resource to manage ALSA scart out source */\r
- RI_CATEGORY_MM_PCM_OUT, /**< PCM out - used by mm-player */\r
- RI_CATEGORY_AUDIO_DECODER_PRIMARY, /**< Primary Audio Decoder */\r
- RI_CATEGORY_AUDIO_DECODER_SUB, /**< Sub Audio Decoder */\r
- RI_CATEGORY_JPEG_DECODER, /**< JPEG Decoder */\r
- RI_CATEGORY_SCALER_SUB, /**< Sub Scaler */\r
- RI_CATEGORY_EXT_VIDEO_SRC, /**< Logical resource to manage video input path - used by player */\r
- RI_CATEGORY_EXT_AUDIO_SRC, /**< Logical resource to manage audio input path - used by player */\r
- RI_CATEGORY_EXT_HDMI_SRC, /**< Logical resource to manage hdmi input path - used by player */\r
- RI_CATEGORY_VIDEO_DECODER_SUB, /**< Sub Video Decoder - MFD (Multi F ormat Decoder), FullHD */\r
- RI_CATEGORY_CAMERA, /**< Logical resource to manage camera device */\r
- RI_CATEGORY_DEMUX_REC, /**< Demux for recording */\r
- RI_CATEGORY_TUNER_SUB, /**< Sub Tuner */\r
- RI_CATEGORY_MJPEG_DECODER, /**< MJPEG decoder */\r
-\r
- RI_CATEGORY_INPUT_SRC_DTV, /**< input source dtv */\r
- RI_CATEGORY_INPUT_SRC_ATV, /**< input source atv */\r
- RI_CATEGORY_INPUT_SRC_HDMI, /**< input source hdmi */\r
- RI_CATEGORY_INPUT_SRC_COMP, /**< input source comp */\r
- RI_CATEGORY_INPUT_SRC_AV, /**< input source av */\r
- RI_CATEGORY_INPUT_SRC_SCART, /**< input source scart */\r
-\r
- RI_CATEGORY_MIC, /**< MIC */\r
- RI_CATEGORY_EXT_COMP_SRC, /**< ext comp src */\r
- RI_CATEGORY_EXT_AV_SRC, /**< ext av src */\r
- RI_CATEGORY_SW_DECODER, /**< sw decoder */\r
- RI_CATEGORY_VIRTUAL_RESOURCE, /**< deprecated */\r
- RI_CATEGORY_VIRTUAL_TOKEN, /**< deprecated */\r
- RI_CATEGORY_MMP_MEMORY_CLUSTER, /**< deprecated */\r
-\r
- RI_CATEGORY_EXT_AUDIO_SRC_DVI, /**< external audio source DVI - LFD only */\r
- RI_CATEGORY_EXT_AUDIO_SRC_HDMI, /**< external audio source HDMI - LFD only */\r
- RI_CATEGORY_EXT_AUDIO_SRC_DP, /**< external audio source Display Port - LFD only */\r
- RI_CATEGORY_EXT_AUDIO_SRC_SBB, /**< external audio source Magic Info I - LFD only */\r
- RI_CATEGORY_EXT_AUDIO_SRC_OPS, /**< external audio source PIM(Plug In Module) - LFD only */\r
- RI_CATEGORY_EXT_VIDEO_SRC_DVI, /**< external video source DVI - LFD only */\r
- RI_CATEGORY_EXT_VIDEO_SRC_HDMI, /**< external video source HDMI - LFD only */\r
- RI_CATEGORY_EXT_VIDEO_SRC_DP, /**< external video source Display Port - LFD only */\r
- RI_CATEGORY_EXT_VIDEO_SRC_SBB, /**< external video source Magic Info I - LFD only */\r
- RI_CATEGORY_EXT_VIDEO_SRC_OPS, /**< external video source PIM(Plug In Module) - LFD only */\r
- RI_CATEGORY_EXT_PC_SRC, /**< external video source PC */\r
-\r
-\r
- RI_CATEGORY_AUDIO_EVENT_COMPRESS, /**< audio event compress */\r
-\r
- RI_CATEGORY_SCALER_BG, /**< Scaler for Background */\r
- RI_CATEGORY_AUDIO_SUB_OUT, /**< Logical resource to manage ALSA sub out source */\r
- RI_CATEGORY_GRAPHIC_PLANE, /**< Logical resource to manage Graphic plane */\r
- RI_CATEGORY_DISPLAY_OUT, /**< Logical resource to manage display out */\r
- RI_CATEGORY_IMAGE_DECODER, /**< Image decoder */\r
- RI_CATEGORY_VIDEO_ENCODER_EXCLUSIVE, /**< Video encoder - dedicated to duo scenario */\r
- RI_CATEGORY_AUDIO_MAIN_OUT_SHARE, /**< Logical resource to manage ALSA main out source - sharable support since version 4.0*/\r
- RI_CATEGORY_VIDEO_ENCODER_MULTI, /**< Video encoder for multi encoding, support since version 5.0 */\r
-\r
- RI_CATEGORY_JPEG_DECODER_OPTION = 500, /**< JPEG Decoder option max*/\r
- RI_CATEGORY_JPEG_DECODER_FHD, /**< FHD JPEG Decoder */\r
- RI_CATEGORY_JPEG_DECODER_UHD, /**< UHD JPEG Decoder */\r
- RI_CATEGORY_JPEG_DECODER_8K, /**< 8K JPEG Decoder */\r
-\r
- RI_CATEGORY_MJPEG_DECODER_OPTION = 600, /**< MJPEG Decoder option min*/\r
- RI_CATEGORY_MJPEG_DECODER_FHD, /**< FHD MJPEG Decoder */\r
- RI_CATEGORY_MJPEG_DECODER_UHD, /**< UHD MJPEG Decoder */\r
- RI_CATEGORY_MJPEG_DECODER_8K, /**< 8K MJPEG Decoder */\r
-\r
- RI_CATEGORY_HEIC_DECODER_OPTION = 650, /**< HEIC Decoder option min */\r
- RI_CATEGORY_HEIC_DECODER, /**< HEIC Decoder */\r
-\r
- RI_CATEGORY_AUDIO_DECODER_OPTION = 700, /**< 700: Audio decoder option */\r
- RI_CATEGORY_AUDIO_DECODER_ANY, /**< 701: Audio decoder any */\r
- RI_CATEGORY_AUDIO_DECODER_NOT_SUPPORTED, /**< 702: Audio decoder is not supported */\r
- RI_CATEGORY_AUDIO_DECODER_MPEG, /**< 703: Audio decoder for MPEG (MP1, MP2, MP3) */\r
- RI_CATEGORY_AUDIO_DECODER_AC3, /**< 704: Audio decoder for AC3 */\r
- RI_CATEGORY_AUDIO_DECODER_E_AC3, /**< 705: Audio decoder for E-AC3 */\r
- RI_CATEGORY_AUDIO_DECODER_TRUEHD, /**< 706: Audio decoder for TrueHD */\r
- RI_CATEGORY_AUDIO_DECODER_AC4, /**< 707: Audio decoder for AC4 */\r
- RI_CATEGORY_AUDIO_DECODER_VORBIS, /**< 708: Audio decoder for Vorbis */\r
- RI_CATEGORY_AUDIO_DECODER_G2COOK, /**< 709: Audio decoder for G2Cook */\r
- RI_CATEGORY_AUDIO_DECODER_AAC, /**< 710: Audio decoder for AAC */\r
- RI_CATEGORY_AUDIO_DECODER_HE_AAC, /**< 711: Audio decoder for HE-AAC */\r
- RI_CATEGORY_AUDIO_DECODER_WMA, /**< 712: Audio decoder for WMA */\r
- RI_CATEGORY_AUDIO_DECODER_ADPCM, /**< 713: Audio decoder for ADPCM */\r
- RI_CATEGORY_AUDIO_DECODER_MPEG_H, /**< 714: Audio decoder for MPEG-H */\r
- RI_CATEGORY_AUDIO_DECODER_OPUS, /**< 715: Audio decoder for OPUS */\r
- RI_CATEGORY_AUDIO_DECODER_PCM, /**< 716: Audio decoder for PCM */\r
- RI_CATEGORY_AUDIO_DECODER_IAMF_OPUS, /**< 717: Audio decoder for IAMF_OPUS */\r
- RI_CATEGORY_AUDIO_OFFLOAD, /**< 718: Audio offload */\r
-\r
- RI_CATEGORY_RADIO, /**< 719: Radio */\r
-\r
- RI_CATEGORY_SCALER_OPTION = 900, /**< 900: Video scaler option */\r
- RI_CATEGORY_SCALER_MULTIVIEW, /**< 901: Video scaler for multiview */\r
- RI_CATEGORY_SCALER_SUB2, /**< 902: Video scaler sub2 */\r
- RI_CATEGORY_SCALER_SUB3, /**< 903: Video scaler sub3 */\r
- RI_CATEGORY_SCALER_VR360_DETILED, /**< 904: Video scaler for VR360 detailed */\r
- RI_CATEGORY_SCALER_VR360_NATIVE_OUT, /**< 905: Video scaler for native VR360 out */\r
- RI_CATEGORY_SCALER_INTERLACED, /**< 906: Video scaler for interlaced stream */\r
- RI_CATEGORY_SCALER_8K, /**< 907: Scaler for 8K output */\r
- RI_CATEGORY_SCALER_PROGRESSIVE, /**< 908: Video scaler for progressive stream, support since version 4.0 */\r
- RI_CATEGORY_SCALER_HDMI, /**< 909: Video scaler for HDMI input, support since version 4.0 */\r
- RI_CATEGORY_SCALER_HDMI_SUB, /**< 910: Video scaler sub for HDMI input, support since version 4.0 */\r
- RI_CATEGORY_SCALER_HDMI_MV, /**< 911: Video scaler for HDMI input multiview, support since version 4.0 */\r
- RI_CATEGORY_SCALER_MINIMAP, /**< 912: Video scaler for Minimap, support since version 5.0 */\r
- RI_CATEGORY_SCALER_MULTI_HDMI, /**< 913: Video scaler for Multi-HDMI input, support since version 5.3 */\r
- RI_CATEGORY_SCALER_INAPP_MULTIVIEW, /**< 914: Video scaler for inapp multiview, support since version 5.4 */\r
- RI_CATEGORY_SCALER_GSR, /**< 915: Video scaler for GSR feature, support since version 6.0 */\r
-\r
- RI_CATEGORY_VIDEO_DECODER_OPTION = 1000,\r
- RI_CATEGORY_VIDEO_DECODER_UHD, /**< 1001: Video Decoder, UHD */\r
- RI_CATEGORY_VIDEO_DECODER_MPEG1_FHD_8BIT_30P, /**< 1002: video decoder for mjpeg */\r
- RI_CATEGORY_VIDEO_DECODER_MPEG1_FHD_8BIT_60P, /**< 1003: video decoder for mjpeg */\r
- RI_CATEGORY_VIDEO_DECODER_MPEG2_FHD_8BIT_30P, /**< 1004: video decoder for mjpeg */\r
- RI_CATEGORY_VIDEO_DECODER_MPEG2_FHD_8BIT_60P, /**< 1005: video decoder for mjpeg */\r
- RI_CATEGORY_VIDEO_DECODER_MPEG4_FHD_8BIT_30P, /**< 1006: video decoder for mjpeg */\r
- RI_CATEGORY_VIDEO_DECODER_MPEG4_FHD_8BIT_60P, /**< 1007: video decoder for mjpeg */\r
- RI_CATEGORY_VIDEO_DECODER_H263_FHD_8BIT_30P, /**< 1008: video decoder for h263 */\r
- RI_CATEGORY_VIDEO_DECODER_H263_FHD_8BIT_60P, /**< 1009: video decoder for h263 */\r
- RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_30P, /**< 1010: video decoder for h264 */\r
- RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_60P, /**< 1011: video decoder for h264 */\r
- RI_CATEGORY_VIDEO_DECODER_H264_UHD_8BIT_30P, /**< 1012: video decoder for h264 */\r
- RI_CATEGORY_VIDEO_DECODER_H264_UHD_8BIT_60P, /**< 1013: video decoder for h264 */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_FHD_8BIT_30P, /**< 1014: video decoder for hevc */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_FHD_8BIT_60P, /**< 1015: video decoder for hevc */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_FHD_10BIT_30P, /**< 1016: video decoder for hevc */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_FHD_10BIT_60P, /**< 1017: video decoder for hevc */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_FHD_10BIT_420_30P, /**< 1018: video decoder for hevc */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_FHD_10BIT_420_60P, /**< 1019: video decoder for hevc */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_FHD_10BIT_422_30P, /**< 1020: video decoder for hevc */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_FHD_10BIT_422_60P, /**< 1021: video decoder for hevc */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_UHD_8BIT_30P, /**< 1022: video decoder for hevc */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_UHD_8BIT_60P, /**< 1023: video decoder for hevc */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_UHD_10BIT_30P, /**< 1024: video decoder for hevc */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_UHD_10BIT_60P, /**< 1025: video decoder for hevc */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_UHD_10BIT_420_30P, /**< 1026: video decoder for hevc */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_UHD_10BIT_420_60P, /**< 1027: video decoder for hevc */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_UHD_10BIT_422_30P, /**< 1028: video decoder for hevc */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_UHD_10BIT_422_60P, /**< 1029: video decoder for hevc */\r
- RI_CATEGORY_VIDEO_DECODER_VP8_FHD_8BIT_30P, /**< 1030: video decoder for vp8 */\r
- RI_CATEGORY_VIDEO_DECODER_VP8_FHD_8BIT_60P, /**< 1031: video decoder for vp8 */\r
- RI_CATEGORY_VIDEO_DECODER_VP9_FHD_8BIT_30P, /**< 1032: video decoder for vp9 */\r
- RI_CATEGORY_VIDEO_DECODER_VP9_FHD_8BIT_60P, /**< 1033: video decoder for vp9 */\r
- RI_CATEGORY_VIDEO_DECODER_VP9_UHD_8BIT_30P, /**< 1034: video decoder for vp9 */\r
- RI_CATEGORY_VIDEO_DECODER_VP9_UHD_8BIT_60P, /**< 1035: video decoder for vp9 */\r
- RI_CATEGORY_VIDEO_DECODER_RV_FHD_8BIT_30P, /**< 1036: video decoder for vp9 */\r
- RI_CATEGORY_VIDEO_DECODER_RV_FHD_8BIT_60P, /**< 1037: video decoder for vp9 */\r
- RI_CATEGORY_VIDEO_DECODER_WMV9_FHD_8BIT_30P, /**< 1038: video decoder for vp9 */\r
- RI_CATEGORY_VIDEO_DECODER_WMV9_FHD_8BIT_60P, /**< 1039: video decoder for vp9 */\r
- RI_CATEGORY_VIDEO_DECODER_AVS_FHD_8BIT_30P, /**< 1040: video decoder for vp9 */\r
- RI_CATEGORY_VIDEO_DECODER_AVS_FHD_8BIT_60P, /**< 1041: video decoder for vp9 */\r
- RI_CATEGORY_VIDEO_DECODER_AVS_PLUS_FHD_8BIT_30P, /**< 1042: video decoder for vp9 */\r
- RI_CATEGORY_VIDEO_DECODER_AVS_PLUS_FHD_8BIT_60P, /**< 1043: video decoder for vp9 */\r
-\r
- //VR360\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_FHD_8BIT_30P, /**< 1044: video decoder for h264 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_FHD_8BIT_60P, /**< 1045: video decoder for h264 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_UHD_8BIT_30P, /**< 1046: video decoder for h264 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_UHD_8BIT_60P, /**< 1047: video decoder for h264 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_FHD_10BIT_30P, /**< 1048: video decoder for h264 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_FHD_10BIT_60P, /**< 1049: video decoder for h264 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_UHD_10BIT_30P, /**< 1050: video decoder for h264 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_UHD_10BIT_60P, /**< 1051: video decoder for h264 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_FHD_10BIT_420_30P,/**< 1052: video decoder for h264 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_FHD_10BIT_420_60P,/**< 1053: video decoder for h264 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_UHD_10BIT_420_30P,/**< 1054: video decoder for h264 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_UHD_10BIT_420_60P,/**< 1055: video decoder for h264 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_FHD_10BIT_422_30P,/**< 1056: video decoder for h264 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_FHD_10BIT_422_60P,/**< 1057: video decoder for h264 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_UHD_10BIT_422_30P,/**< 1058: video decoder for h264 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_UHD_10BIT_422_60P,/**< 1059: video decoder for h264 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_H264_VR360_FHD_8BIT_30P, /**< 1060: video decoder for h264 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_H264_VR360_FHD_8BIT_60P, /**< 1061: video decoder for h264 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_H264_VR360_UHD_8BIT_30P, /**< 1062: video decoder for h264 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_H264_VR360_UHD_8BIT_60P, /**< 1063: video decoder for h264 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_VP9_VR360_FHD_8BIT_30P, /**< 1064: video decoder for vp9 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_VP9_VR360_FHD_8BIT_60P, /**< 1065: video decoder for vp9 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_VP9_VR360_UHD_8BIT_30P, /**< 1066: video decoder for vp9 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_VP9_VR360_UHD_8BIT_60P, /**< 1067: video decoder for vp9 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_VP9_VR360_FHD_10BIT_30P, /**< 1068: video decoder for vp9 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_VP9_VR360_FHD_10BIT_60P, /**< 1069: video decoder for vp9 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_VP9_VR360_UHD_10BIT_30P, /**< 1070: video decoder for vp9 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_VP9_VR360_UHD_10BIT_60P, /**< 1071: video decoder for vp9 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_VP9_VR360_FHD_10BIT_420_30P, /**< 1072: video decoder for vp9 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_VP9_VR360_FHD_10BIT_420_60P, /**< 1073: video decoder for vp9 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_VP9_VR360_UHD_10BIT_420_30P, /**< 1074: video decoder for vp9 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_VP9_VR360_UHD_10BIT_420_60P, /**< 1075: video decoder for vp9 vr360 */\r
-\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_SHVC_8BIT_30P, /**< 1076: video decoder for hevc shvc */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_SHVC_8BIT_60P, /**< 1077: video decoder for hevc shvc */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_SHVC_10BIT_30P, /**< 1078: video decoder for hevc shvc */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_SHVC_10BIT_60P, /**< 1079: video decoder for hevc shvc */\r
-\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_8K_8BIT_30P, /**< 1080: video decoder for hevc 8k */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_8K_8BIT_60P, /**< 1081: video decoder for hevc 8k */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_8K_10BIT_30P, /**< 1082: video decoder for hevc 8k */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_8K_10BIT_60P, /**< 1083: video decoder for hevc 8k */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_8K_10BIT_420_30P, /**< 1084: video decoder for hevc 8k */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_8K_10BIT_420_60P, /**< 1085: video decoder for hevc 8k */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_UHD_8BIT_120P, /**< 1086: video decoder for hevc */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_UHD_10BIT_120P, /**< 1087: video decoder for hevc */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_UHD_10BIT_420_120P, /**< 1088: video decoder for hevc */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_UHD_10BIT_422_120P, /**< 1089: video decoder for hevc */\r
-\r
- RI_CATEGORY_VIDEO_DECODER_AV1_FHD_8BIT_30P, /**< 1090: video decoder for av1 */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_FHD_8BIT_60P, /**< 1091: video decoder for av1 */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_FHD_10BIT_30P, /**< 1092: video decoder for av1 */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_FHD_10BIT_60P, /**< 1093: video decoder for av1 */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_UHD_8BIT_30P, /**< 1094: video decoder for av1 */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_UHD_8BIT_60P, /**< 1095: video decoder for av1 */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_UHD_10BIT_30P, /**< 1096: video decoder for av1 */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_UHD_10BIT_60P, /**< 1097: video decoder for av1 */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_8K_8BIT_30P, /**< 1098: video decoder for av1 8k */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_8K_8BIT_60P, /**< 1099: video decoder for av1 8k */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_8K_10BIT_30P, /**< 1100: video decoder for av1 8k */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_8K_10BIT_60P, /**< 1101: video decoder for av1 8k */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_VR360_FHD_8BIT_30P, /**< 1102: video decoder for vp9 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_VR360_FHD_8BIT_60P, /**< 1103: video decoder for vp9 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_VR360_FHD_10BIT_30P, /**< 1104: video decoder for vp9 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_VR360_FHD_10BIT_60P, /**< 1105: video decoder for vp9 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_VR360_UHD_8BIT_30P, /**< 1106: video decoder for vp9 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_VR360_UHD_8BIT_60P, /**< 1107: video decoder for vp9 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_VR360_UHD_10BIT_30P, /**< 1108: video decoder for vp9 vr360 */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_VR360_UHD_10BIT_60P, /**< 1109: video decoder for vp9 vr360 */\r
-\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_FHD_8BIT_120P, /**< 1110: video decoder for hevc */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_FHD_10BIT_120P, /**< 1111: video decoder for hevc */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_FHD_10BIT_422_120P, /**< 1112: video decoder for hevc */\r
- RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_120P, /**< 1113: video decoder for h264 */\r
- RI_CATEGORY_VIDEO_DECODER_H264_HD_8BIT_30P, /**< 1114: video decoder for h264 */\r
-\r
- RI_CATEGORY_VIDEO_DECODER_MPEG1_FHD_8BIT_120P, /**< 1115: video decoder for mpeg1 */\r
- RI_CATEGORY_VIDEO_DECODER_MPEG2_FHD_8BIT_120P, /**< 1116: video decoder for mpeg2 */\r
- RI_CATEGORY_VIDEO_DECODER_MPEG4_FHD_8BIT_120P, /**< 1117: video decoder for mpeg4 */\r
- RI_CATEGORY_VIDEO_DECODER_H263_FHD_8BIT_120P, /**< 1118: video decoder for h263 */\r
- RI_CATEGORY_VIDEO_DECODER_VP8_FHD_8BIT_120P, /**< 1119: video decoder for vp8 */\r
- RI_CATEGORY_VIDEO_DECODER_VP9_FHD_8BIT_120P, /**< 1120: video decoder for vp9 */\r
- RI_CATEGORY_VIDEO_DECODER_VP9_FHD_10BIT_120P, /**< 1121: video decoder for vp9 */\r
- RI_CATEGORY_VIDEO_DECODER_RV_FHD_8BIT_120P, /**< 1122: video decoder for rv */\r
- RI_CATEGORY_VIDEO_DECODER_WMV9_FHD_8BIT_120P, /**< 1123: video decoder for wmv9 */\r
- RI_CATEGORY_VIDEO_DECODER_AVS_FHD_8BIT_120P, /**< 1124: video decoder for avs */\r
- RI_CATEGORY_VIDEO_DECODER_AVS_PLUS_FHD_8BIT_120P, /**< 1125: video decoder for avs+ */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_FHD_8BIT_120P, /**< 1126: video decoder for av1 */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_FHD_10BIT_120P, /**< 1127: video decoder for av1 */\r
-\r
- RI_CATEGORY_VIDEO_DECODER_AVS2_FHD_8BIT_30P, /**< 1128: video decoder for avs2 */\r
- RI_CATEGORY_VIDEO_DECODER_AVS2_FHD_8BIT_60P, /**< 1129: video decoder for avs2 */\r
- RI_CATEGORY_VIDEO_DECODER_AVS2_FHD_8BIT_120P, /**< 1130: video decoder for avs2 */\r
- RI_CATEGORY_VIDEO_DECODER_AVS2_FHD_10BIT_30P, /**< 1131: video decoder for avs2 */\r
- RI_CATEGORY_VIDEO_DECODER_AVS2_FHD_10BIT_60P, /**< 1132: video decoder for avs2 */\r
- RI_CATEGORY_VIDEO_DECODER_AVS2_FHD_10BIT_120P, /**< 1133: video decoder for avs2 */\r
-\r
- RI_CATEGORY_VIDEO_DECODER_AVS2_UHD_8BIT_30P, /**< 1134: video decoder for avs2 */\r
- RI_CATEGORY_VIDEO_DECODER_AVS2_UHD_8BIT_60P, /**< 1135: video decoder for avs2 */\r
- RI_CATEGORY_VIDEO_DECODER_AVS2_UHD_10BIT_30P, /**< 1136: video decoder for avs2 */\r
- RI_CATEGORY_VIDEO_DECODER_AVS2_UHD_10BIT_60P, /**< 1137: video decoder for avs2 */\r
-\r
- RI_CATEGORY_VIDEO_DECODER_VP9_FHD_10BIT_30P, /**< 1138: video decoder for vp9 */\r
- RI_CATEGORY_VIDEO_DECODER_VP9_FHD_10BIT_60P, /**< 1139: video decoder for vp9 */\r
- RI_CATEGORY_VIDEO_DECODER_VP9_UHD_10BIT_30P, /**< 1140: video decoder for vp9 */\r
- RI_CATEGORY_VIDEO_DECODER_VP9_UHD_10BIT_60P, /**< 1141: video decoder for vp9 */\r
-\r
- RI_CATEGORY_VIDEO_DECODER_AV1_UHD_8BIT_120P, /**< 1142: video decoder for av1 */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_UHD_10BIT_120P, /**< 1143: video decoder for av1 */\r
- RI_CATEGORY_VIDEO_DECODER_VP8_qHD_8BIT_30P, /**< 1144: video decoder for vp8 */\r
- RI_CATEGORY_VIDEO_DECODER_H264_FHD_N_8BIT_30P, /**< 1145: video decoder for h264 */\r
- RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_30P_MV, /**< 1146: video decoder for h264 multiview scenario */\r
- RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_60P_MV, /**< 1147: video decoder for h264 multiview scenario */\r
- RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_30P_PORTRAIT, /**< 1148: video decoder for h264 portrait */\r
- RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_60P_PORTRAIT, /**< 1149: video decoder for h264 portrait */\r
- RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_30P_INTERLACED, /**< 1150: video decoder for h264 interlaced */\r
- RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_60P_INTERLACED, /**< 1151: video decoder for h264 interlaced */\r
- RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_30P_PROGRESSIVE,/**< 1152: video decoder dedicated to h264 progressive, support since version 4.0 */\r
- RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_60P_PROGRESSIVE,/**< 1153: video decoder dedicated to h264 progressive, support since version 4.0 */\r
- RI_CATEGORY_VIDEO_DECODER_H264_QuadHD_8BIT_30P, /**< 1154: video decoder for h264, support since version 4.0 */\r
- RI_CATEGORY_VIDEO_DECODER_H264_QuadHD_8BIT_60P, /**< 1155: video decoder for h264, support since version 4.0 */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_DQHD_8BIT_30P, /**< 1156: video decoder for HEVC, support since version 4.0 */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_DQHD_8BIT_60P, /**< 1157: video decoder for HEVC, support since version 4.0 */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_DQHD_10BIT_30P, /**< 1158: video decoder for HEVC, support since version 4.0 */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_DQHD_10BIT_60P, /**< 1159: video decoder for HEVC, support since version 4.0 */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_DQHD_8BIT_30P, /**< 1160: video decoder for AV1, support since version 4.0 */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_DQHD_8BIT_60P, /**< 1161: video decoder for AV1, support since version 4.0 */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_DQHD_10BIT_30P, /**< 1162: video decoder for AV1, support since version 4.0 */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_DQHD_10BIT_60P, /**< 1163: video decoder for AV1, support since version 4.0 */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_5K_8BIT_30P, /**< 1164: video decoder for HEVC, support since version 5.3 */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_5K_8BIT_60P, /**< 1165: video decoder for HEVC, support since version 5.3 */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_5K_10BIT_30P, /**< 1166: video decoder for HEVC, support since version 5.3 */\r
- RI_CATEGORY_VIDEO_DECODER_HEVC_5K_10BIT_60P, /**< 1167: video decoder for HEVC, support since version 5.3 */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_5K_8BIT_30P, /**< 1168: video decoder for AV1, support since version 5.3 */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_5K_8BIT_60P, /**< 1169: video decoder for AV1, support since version 5.3 */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_5K_10BIT_30P, /**< 1170: video decoder for AV1, support since version 5.3 */\r
- RI_CATEGORY_VIDEO_DECODER_AV1_5K_10BIT_60P, /**< 1171: video decoder for AV1, support since version 5.3 */\r
- RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_30P_TRIPLE, /**< 1172: video decoder for h264 triple decoding, support since version 5.4 */\r
- RI_CATEGORY_VIDEO_DECODER_VVC_FHD_8BIT_30P, /**< 1173: video decoder for VVC(H.266), support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_VVC_FHD_8BIT_60P, /**< 1174: video decoder for VVC(H.266), support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_VVC_FHD_8BIT_120P, /**< 1175: video decoder for VVC(H.266), support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_VVC_FHD_10BIT_30P, /**< 1176: video decoder for VVC(H.266), support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_VVC_FHD_10BIT_60P, /**< 1177: video decoder for VVC(H.266), support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_VVC_FHD_10BIT_120P, /**< 1178: video decoder for VVC(H.266), support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_VVC_UHD_8BIT_30P, /**< 1179: video decoder for VVC(H.266), support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_VVC_UHD_8BIT_60P, /**< 1180: video decoder for VVC(H.266), support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_VVC_UHD_8BIT_120P, /**< 1181: video decoder for VVC(H.266), support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_VVC_UHD_10BIT_30P, /**< 1182: video decoder for VVC(H.266), support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_VVC_UHD_10BIT_60P, /**< 1183: video decoder for VVC(H.266), support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_VVC_UHD_10BIT_120P, /**< 1184: video decoder for VVC(H.266), support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_VVC_8K_8BIT_30P, /**< 1185: video decoder for VVC(H.266), support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_VVC_8K_8BIT_60P, /**< 1186: video decoder for VVC(H.266), support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_VVC_8K_10BIT_30P, /**< 1187: video decoder for VVC(H.266), support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_VVC_8K_10BIT_60P, /**< 1188: video decoder for VVC(H.266), support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_VP9_8K_8BIT_30P, /**< 1189: video decoder for VP9, support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_VP9_8K_8BIT_60P, /**< 1190: video decoder for VP9, support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_VP9_8K_10BIT_30P, /**< 1191: video decoder for VP9, support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_VP9_8K_10BIT_60P, /**< 1192: video decoder for VP9, support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_AVS3_FHD_8BIT_30P, /**< 1193: video decoder for AVS3, support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_AVS3_FHD_8BIT_60P, /**< 1194: video decoder for AVS3, support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_AVS3_FHD_8BIT_120P, /**< 1195: video decoder for AVS3, support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_AVS3_FHD_10BIT_30P, /**< 1196: video decoder for AVS3, support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_AVS3_FHD_10BIT_60P, /**< 1197: video decoder for AVS3, support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_AVS3_FHD_10BIT_120P, /**< 1198: video decoder for AVS3, support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_AVS3_UHD_8BIT_30P, /**< 1199: video decoder for AVS3, support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_AVS3_UHD_8BIT_60P, /**< 1200: video decoder for AVS3, support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_AVS3_UHD_8BIT_120P, /**< 1201: video decoder for AVS3, support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_AVS3_UHD_10BIT_30P, /**< 1202: video decoder for AVS3, support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_AVS3_UHD_10BIT_60P, /**< 1203: video decoder for AVS3, support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_AVS3_UHD_10BIT_120P, /**< 1204: video decoder for AVS3, support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_AVS3_8K_8BIT_30P, /**< 1205: video decoder for AVS3, support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_AVS3_8K_8BIT_60P, /**< 1206: video decoder for AVS3, support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_AVS3_8K_10BIT_30P, /**< 1207: video decoder for AVS3, support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_AVS3_8K_10BIT_60P, /**< 1208: video decoder for AVS3, support since version 6.0 */\r
- RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_30P_DETILED, /**< 1209: video decoder for h264 detiled, support since version 6.4 */\r
- RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_60P_DETILED /**< 1210: video decoder for h264 detiled, support since version 6.4 */\r
-} ri_rsc_category_e;\r
-\r
-#endif// __RI_CATEGORY_TYPE_H__\r
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#ifndef __RI_CATEGORY_TYPE_H__
+#define __RI_CATEGORY_TYPE_H__
+
+/**
+ * @enum ri_rsc_category_e
+ * @brief The id of resource category to which device belongs
+ * Equals to device type
+ * @version 4.0
+ */
+typedef enum {
+ RI_CATEGORY_VIDEO_ENCODER_NOT_SUPPORTED = -6, /**< Not supported video encoder, support since version 5.0 */
+ RI_CATEGORY_IMAGE_DECODER_NOT_SUPPORTED = -5, /**< Not supported Image decoder */
+ RI_CATEGORY_NOT_PERMITTED = -4, /**< Not permitted category by resource policy */
+ RI_CATEGORY_MJPEG_DECODER_NOT_SUPPORTED = -3, /**< Not supported MJPEG decoder */
+ RI_CATEGORY_JPEG_DECODER_NOT_SUPPORTED = -2, /**< Not supported JPEG decoder */
+ RI_CATEGORY_VIDEO_DECODER_NOT_SUPPORTED = -1, /**< Not supported video decoder */
+ RI_CATEGORY_NONE = 0, /**< no category information */
+ RI_CATEGORY_AUDIO_DECODER = 1, /**< Audio Decoder */
+ RI_CATEGORY_AUDIO_SPDIF_ES_OUTPUT, /**< spdif es output */
+ RI_CATEGORY_VIDEO_DECODER, /**< Video Decoder - MFD (Multi Format Decoder), FullHD */
+ RI_CATEGORY_DEMUX, /**< Demux */
+ RI_CATEGORY_AUDIO_ENCODER, /**< Audio Encoder */
+ RI_CATEGORY_VIDEO_ENCODER, /**< Video Encoder */
+ RI_CATEGORY_SCALER, /**< Main Scaler */
+ RI_CATEGORY_TUNER, /**< Tuner */
+ RI_CATEGORY_AUDIO_MAIN_OUT, /**< Logical resource to manage ALSA main out source */
+ RI_CATEGORY_AUDIO_REMOTE_OUT, /**< Logical resource to manage ALSA remote out source */
+ RI_CATEGORY_AUDIO_SCART_OUT, /**< Logical resource to manage ALSA scart out source */
+ RI_CATEGORY_MM_PCM_OUT, /**< PCM out - used by mm-player */
+ RI_CATEGORY_AUDIO_DECODER_PRIMARY, /**< Primary Audio Decoder */
+ RI_CATEGORY_AUDIO_DECODER_SUB, /**< Sub Audio Decoder */
+ RI_CATEGORY_JPEG_DECODER, /**< JPEG Decoder */
+ RI_CATEGORY_SCALER_SUB, /**< Sub Scaler */
+ RI_CATEGORY_EXT_VIDEO_SRC, /**< Logical resource to manage video input path - used by player */
+ RI_CATEGORY_EXT_AUDIO_SRC, /**< Logical resource to manage audio input path - used by player */
+ RI_CATEGORY_EXT_HDMI_SRC, /**< Logical resource to manage hdmi input path - used by player */
+ RI_CATEGORY_VIDEO_DECODER_SUB, /**< Sub Video Decoder - MFD (Multi F ormat Decoder), FullHD */
+ RI_CATEGORY_CAMERA, /**< Logical resource to manage camera device */
+ RI_CATEGORY_DEMUX_REC, /**< Demux for recording */
+ RI_CATEGORY_TUNER_SUB, /**< Sub Tuner */
+ RI_CATEGORY_MJPEG_DECODER, /**< MJPEG decoder */
+
+ RI_CATEGORY_INPUT_SRC_DTV, /**< input source dtv */
+ RI_CATEGORY_INPUT_SRC_ATV, /**< input source atv */
+ RI_CATEGORY_INPUT_SRC_HDMI, /**< input source hdmi */
+ RI_CATEGORY_INPUT_SRC_COMP, /**< input source comp */
+ RI_CATEGORY_INPUT_SRC_AV, /**< input source av */
+ RI_CATEGORY_INPUT_SRC_SCART, /**< input source scart */
+
+ RI_CATEGORY_MIC, /**< MIC */
+ RI_CATEGORY_EXT_COMP_SRC, /**< ext comp src */
+ RI_CATEGORY_EXT_AV_SRC, /**< ext av src */
+ RI_CATEGORY_SW_DECODER, /**< sw decoder */
+ RI_CATEGORY_VIRTUAL_RESOURCE, /**< deprecated */
+ RI_CATEGORY_VIRTUAL_TOKEN, /**< deprecated */
+ RI_CATEGORY_MMP_MEMORY_CLUSTER, /**< deprecated */
+
+ RI_CATEGORY_EXT_AUDIO_SRC_DVI, /**< external audio source DVI - LFD only */
+ RI_CATEGORY_EXT_AUDIO_SRC_HDMI, /**< external audio source HDMI - LFD only */
+ RI_CATEGORY_EXT_AUDIO_SRC_DP, /**< external audio source Display Port - LFD only */
+ RI_CATEGORY_EXT_AUDIO_SRC_SBB, /**< external audio source Magic Info I - LFD only */
+ RI_CATEGORY_EXT_AUDIO_SRC_OPS, /**< external audio source PIM(Plug In Module) - LFD only */
+ RI_CATEGORY_EXT_VIDEO_SRC_DVI, /**< external video source DVI - LFD only */
+ RI_CATEGORY_EXT_VIDEO_SRC_HDMI, /**< external video source HDMI - LFD only */
+ RI_CATEGORY_EXT_VIDEO_SRC_DP, /**< external video source Display Port - LFD only */
+ RI_CATEGORY_EXT_VIDEO_SRC_SBB, /**< external video source Magic Info I - LFD only */
+ RI_CATEGORY_EXT_VIDEO_SRC_OPS, /**< external video source PIM(Plug In Module) - LFD only */
+ RI_CATEGORY_EXT_PC_SRC, /**< external video source PC */
+
+
+ RI_CATEGORY_AUDIO_EVENT_COMPRESS, /**< audio event compress */
+
+ RI_CATEGORY_SCALER_BG, /**< Scaler for Background */
+ RI_CATEGORY_AUDIO_SUB_OUT, /**< Logical resource to manage ALSA sub out source */
+ RI_CATEGORY_GRAPHIC_PLANE, /**< Logical resource to manage Graphic plane */
+ RI_CATEGORY_DISPLAY_OUT, /**< Logical resource to manage display out */
+ RI_CATEGORY_IMAGE_DECODER, /**< Image decoder */
+ RI_CATEGORY_VIDEO_ENCODER_EXCLUSIVE, /**< Video encoder - dedicated to duo scenario */
+ RI_CATEGORY_AUDIO_MAIN_OUT_SHARE, /**< Logical resource to manage ALSA main out source - sharable support since version 4.0*/
+ RI_CATEGORY_VIDEO_ENCODER_MULTI, /**< Video encoder for multi encoding, support since version 5.0 */
+
+ RI_CATEGORY_JPEG_DECODER_OPTION = 500, /**< JPEG Decoder option max*/
+ RI_CATEGORY_JPEG_DECODER_FHD, /**< FHD JPEG Decoder */
+ RI_CATEGORY_JPEG_DECODER_UHD, /**< UHD JPEG Decoder */
+ RI_CATEGORY_JPEG_DECODER_8K, /**< 8K JPEG Decoder */
+
+ RI_CATEGORY_MJPEG_DECODER_OPTION = 600, /**< MJPEG Decoder option min*/
+ RI_CATEGORY_MJPEG_DECODER_FHD, /**< FHD MJPEG Decoder */
+ RI_CATEGORY_MJPEG_DECODER_UHD, /**< UHD MJPEG Decoder */
+ RI_CATEGORY_MJPEG_DECODER_8K, /**< 8K MJPEG Decoder */
+
+ RI_CATEGORY_HEIC_DECODER_OPTION = 650, /**< HEIC Decoder option min */
+ RI_CATEGORY_HEIC_DECODER, /**< HEIC Decoder */
+
+ RI_CATEGORY_AUDIO_DECODER_OPTION = 700, /**< 700: Audio decoder option */
+ RI_CATEGORY_AUDIO_DECODER_ANY, /**< 701: Audio decoder any */
+ RI_CATEGORY_AUDIO_DECODER_NOT_SUPPORTED, /**< 702: Audio decoder is not supported */
+ RI_CATEGORY_AUDIO_DECODER_MPEG, /**< 703: Audio decoder for MPEG (MP1, MP2, MP3) */
+ RI_CATEGORY_AUDIO_DECODER_AC3, /**< 704: Audio decoder for AC3 */
+ RI_CATEGORY_AUDIO_DECODER_E_AC3, /**< 705: Audio decoder for E-AC3 */
+ RI_CATEGORY_AUDIO_DECODER_TRUEHD, /**< 706: Audio decoder for TrueHD */
+ RI_CATEGORY_AUDIO_DECODER_AC4, /**< 707: Audio decoder for AC4 */
+ RI_CATEGORY_AUDIO_DECODER_VORBIS, /**< 708: Audio decoder for Vorbis */
+ RI_CATEGORY_AUDIO_DECODER_G2COOK, /**< 709: Audio decoder for G2Cook */
+ RI_CATEGORY_AUDIO_DECODER_AAC, /**< 710: Audio decoder for AAC */
+ RI_CATEGORY_AUDIO_DECODER_HE_AAC, /**< 711: Audio decoder for HE-AAC */
+ RI_CATEGORY_AUDIO_DECODER_WMA, /**< 712: Audio decoder for WMA */
+ RI_CATEGORY_AUDIO_DECODER_ADPCM, /**< 713: Audio decoder for ADPCM */
+ RI_CATEGORY_AUDIO_DECODER_MPEG_H, /**< 714: Audio decoder for MPEG-H */
+ RI_CATEGORY_AUDIO_DECODER_OPUS, /**< 715: Audio decoder for OPUS */
+ RI_CATEGORY_AUDIO_DECODER_PCM, /**< 716: Audio decoder for PCM */
+ RI_CATEGORY_AUDIO_DECODER_IAMF_OPUS, /**< 717: Audio decoder for IAMF_OPUS */
+ RI_CATEGORY_AUDIO_OFFLOAD, /**< 718: Audio offload */
+
+ RI_CATEGORY_RADIO, /**< 719: Radio */
+
+ RI_CATEGORY_SCALER_OPTION = 900, /**< 900: Video scaler option */
+ RI_CATEGORY_SCALER_MULTIVIEW, /**< 901: Video scaler for multiview */
+ RI_CATEGORY_SCALER_SUB2, /**< 902: Video scaler sub2 */
+ RI_CATEGORY_SCALER_SUB3, /**< 903: Video scaler sub3 */
+ RI_CATEGORY_SCALER_VR360_DETILED, /**< 904: Video scaler for VR360 detailed */
+ RI_CATEGORY_SCALER_VR360_NATIVE_OUT, /**< 905: Video scaler for native VR360 out */
+ RI_CATEGORY_SCALER_INTERLACED, /**< 906: Video scaler for interlaced stream */
+ RI_CATEGORY_SCALER_8K, /**< 907: Scaler for 8K output */
+ RI_CATEGORY_SCALER_PROGRESSIVE, /**< 908: Video scaler for progressive stream, support since version 4.0 */
+ RI_CATEGORY_SCALER_HDMI, /**< 909: Video scaler for HDMI input, support since version 4.0 */
+ RI_CATEGORY_SCALER_HDMI_SUB, /**< 910: Video scaler sub for HDMI input, support since version 4.0 */
+ RI_CATEGORY_SCALER_HDMI_MV, /**< 911: Video scaler for HDMI input multiview, support since version 4.0 */
+ RI_CATEGORY_SCALER_MINIMAP, /**< 912: Video scaler for Minimap, support since version 5.0 */
+ RI_CATEGORY_SCALER_MULTI_HDMI, /**< 913: Video scaler for Multi-HDMI input, support since version 5.3 */
+ RI_CATEGORY_SCALER_INAPP_MULTIVIEW, /**< 914: Video scaler for inapp multiview, support since version 5.4 */
+ RI_CATEGORY_SCALER_GSR, /**< 915: Video scaler for GSR feature, support since version 6.0 */
+
+ RI_CATEGORY_VIDEO_DECODER_OPTION = 1000,
+ RI_CATEGORY_VIDEO_DECODER_UHD, /**< 1001: Video Decoder, UHD */
+ RI_CATEGORY_VIDEO_DECODER_MPEG1_FHD_8BIT_30P, /**< 1002: video decoder for mjpeg */
+ RI_CATEGORY_VIDEO_DECODER_MPEG1_FHD_8BIT_60P, /**< 1003: video decoder for mjpeg */
+ RI_CATEGORY_VIDEO_DECODER_MPEG2_FHD_8BIT_30P, /**< 1004: video decoder for mjpeg */
+ RI_CATEGORY_VIDEO_DECODER_MPEG2_FHD_8BIT_60P, /**< 1005: video decoder for mjpeg */
+ RI_CATEGORY_VIDEO_DECODER_MPEG4_FHD_8BIT_30P, /**< 1006: video decoder for mjpeg */
+ RI_CATEGORY_VIDEO_DECODER_MPEG4_FHD_8BIT_60P, /**< 1007: video decoder for mjpeg */
+ RI_CATEGORY_VIDEO_DECODER_H263_FHD_8BIT_30P, /**< 1008: video decoder for h263 */
+ RI_CATEGORY_VIDEO_DECODER_H263_FHD_8BIT_60P, /**< 1009: video decoder for h263 */
+ RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_30P, /**< 1010: video decoder for h264 */
+ RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_60P, /**< 1011: video decoder for h264 */
+ RI_CATEGORY_VIDEO_DECODER_H264_UHD_8BIT_30P, /**< 1012: video decoder for h264 */
+ RI_CATEGORY_VIDEO_DECODER_H264_UHD_8BIT_60P, /**< 1013: video decoder for h264 */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_FHD_8BIT_30P, /**< 1014: video decoder for hevc */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_FHD_8BIT_60P, /**< 1015: video decoder for hevc */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_FHD_10BIT_30P, /**< 1016: video decoder for hevc */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_FHD_10BIT_60P, /**< 1017: video decoder for hevc */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_FHD_10BIT_420_30P, /**< 1018: video decoder for hevc */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_FHD_10BIT_420_60P, /**< 1019: video decoder for hevc */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_FHD_10BIT_422_30P, /**< 1020: video decoder for hevc */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_FHD_10BIT_422_60P, /**< 1021: video decoder for hevc */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_UHD_8BIT_30P, /**< 1022: video decoder for hevc */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_UHD_8BIT_60P, /**< 1023: video decoder for hevc */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_UHD_10BIT_30P, /**< 1024: video decoder for hevc */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_UHD_10BIT_60P, /**< 1025: video decoder for hevc */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_UHD_10BIT_420_30P, /**< 1026: video decoder for hevc */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_UHD_10BIT_420_60P, /**< 1027: video decoder for hevc */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_UHD_10BIT_422_30P, /**< 1028: video decoder for hevc */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_UHD_10BIT_422_60P, /**< 1029: video decoder for hevc */
+ RI_CATEGORY_VIDEO_DECODER_VP8_FHD_8BIT_30P, /**< 1030: video decoder for vp8 */
+ RI_CATEGORY_VIDEO_DECODER_VP8_FHD_8BIT_60P, /**< 1031: video decoder for vp8 */
+ RI_CATEGORY_VIDEO_DECODER_VP9_FHD_8BIT_30P, /**< 1032: video decoder for vp9 */
+ RI_CATEGORY_VIDEO_DECODER_VP9_FHD_8BIT_60P, /**< 1033: video decoder for vp9 */
+ RI_CATEGORY_VIDEO_DECODER_VP9_UHD_8BIT_30P, /**< 1034: video decoder for vp9 */
+ RI_CATEGORY_VIDEO_DECODER_VP9_UHD_8BIT_60P, /**< 1035: video decoder for vp9 */
+ RI_CATEGORY_VIDEO_DECODER_RV_FHD_8BIT_30P, /**< 1036: video decoder for vp9 */
+ RI_CATEGORY_VIDEO_DECODER_RV_FHD_8BIT_60P, /**< 1037: video decoder for vp9 */
+ RI_CATEGORY_VIDEO_DECODER_WMV9_FHD_8BIT_30P, /**< 1038: video decoder for vp9 */
+ RI_CATEGORY_VIDEO_DECODER_WMV9_FHD_8BIT_60P, /**< 1039: video decoder for vp9 */
+ RI_CATEGORY_VIDEO_DECODER_AVS_FHD_8BIT_30P, /**< 1040: video decoder for vp9 */
+ RI_CATEGORY_VIDEO_DECODER_AVS_FHD_8BIT_60P, /**< 1041: video decoder for vp9 */
+ RI_CATEGORY_VIDEO_DECODER_AVS_PLUS_FHD_8BIT_30P, /**< 1042: video decoder for vp9 */
+ RI_CATEGORY_VIDEO_DECODER_AVS_PLUS_FHD_8BIT_60P, /**< 1043: video decoder for vp9 */
+
+ //VR360
+ RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_FHD_8BIT_30P, /**< 1044: video decoder for h264 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_FHD_8BIT_60P, /**< 1045: video decoder for h264 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_UHD_8BIT_30P, /**< 1046: video decoder for h264 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_UHD_8BIT_60P, /**< 1047: video decoder for h264 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_FHD_10BIT_30P, /**< 1048: video decoder for h264 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_FHD_10BIT_60P, /**< 1049: video decoder for h264 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_UHD_10BIT_30P, /**< 1050: video decoder for h264 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_UHD_10BIT_60P, /**< 1051: video decoder for h264 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_FHD_10BIT_420_30P,/**< 1052: video decoder for h264 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_FHD_10BIT_420_60P,/**< 1053: video decoder for h264 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_UHD_10BIT_420_30P,/**< 1054: video decoder for h264 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_UHD_10BIT_420_60P,/**< 1055: video decoder for h264 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_FHD_10BIT_422_30P,/**< 1056: video decoder for h264 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_FHD_10BIT_422_60P,/**< 1057: video decoder for h264 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_UHD_10BIT_422_30P,/**< 1058: video decoder for h264 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_VR360_UHD_10BIT_422_60P,/**< 1059: video decoder for h264 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_H264_VR360_FHD_8BIT_30P, /**< 1060: video decoder for h264 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_H264_VR360_FHD_8BIT_60P, /**< 1061: video decoder for h264 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_H264_VR360_UHD_8BIT_30P, /**< 1062: video decoder for h264 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_H264_VR360_UHD_8BIT_60P, /**< 1063: video decoder for h264 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_VP9_VR360_FHD_8BIT_30P, /**< 1064: video decoder for vp9 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_VP9_VR360_FHD_8BIT_60P, /**< 1065: video decoder for vp9 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_VP9_VR360_UHD_8BIT_30P, /**< 1066: video decoder for vp9 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_VP9_VR360_UHD_8BIT_60P, /**< 1067: video decoder for vp9 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_VP9_VR360_FHD_10BIT_30P, /**< 1068: video decoder for vp9 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_VP9_VR360_FHD_10BIT_60P, /**< 1069: video decoder for vp9 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_VP9_VR360_UHD_10BIT_30P, /**< 1070: video decoder for vp9 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_VP9_VR360_UHD_10BIT_60P, /**< 1071: video decoder for vp9 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_VP9_VR360_FHD_10BIT_420_30P, /**< 1072: video decoder for vp9 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_VP9_VR360_FHD_10BIT_420_60P, /**< 1073: video decoder for vp9 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_VP9_VR360_UHD_10BIT_420_30P, /**< 1074: video decoder for vp9 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_VP9_VR360_UHD_10BIT_420_60P, /**< 1075: video decoder for vp9 vr360 */
+
+ RI_CATEGORY_VIDEO_DECODER_HEVC_SHVC_8BIT_30P, /**< 1076: video decoder for hevc shvc */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_SHVC_8BIT_60P, /**< 1077: video decoder for hevc shvc */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_SHVC_10BIT_30P, /**< 1078: video decoder for hevc shvc */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_SHVC_10BIT_60P, /**< 1079: video decoder for hevc shvc */
+
+ RI_CATEGORY_VIDEO_DECODER_HEVC_8K_8BIT_30P, /**< 1080: video decoder for hevc 8k */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_8K_8BIT_60P, /**< 1081: video decoder for hevc 8k */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_8K_10BIT_30P, /**< 1082: video decoder for hevc 8k */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_8K_10BIT_60P, /**< 1083: video decoder for hevc 8k */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_8K_10BIT_420_30P, /**< 1084: video decoder for hevc 8k */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_8K_10BIT_420_60P, /**< 1085: video decoder for hevc 8k */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_UHD_8BIT_120P, /**< 1086: video decoder for hevc */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_UHD_10BIT_120P, /**< 1087: video decoder for hevc */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_UHD_10BIT_420_120P, /**< 1088: video decoder for hevc */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_UHD_10BIT_422_120P, /**< 1089: video decoder for hevc */
+
+ RI_CATEGORY_VIDEO_DECODER_AV1_FHD_8BIT_30P, /**< 1090: video decoder for av1 */
+ RI_CATEGORY_VIDEO_DECODER_AV1_FHD_8BIT_60P, /**< 1091: video decoder for av1 */
+ RI_CATEGORY_VIDEO_DECODER_AV1_FHD_10BIT_30P, /**< 1092: video decoder for av1 */
+ RI_CATEGORY_VIDEO_DECODER_AV1_FHD_10BIT_60P, /**< 1093: video decoder for av1 */
+ RI_CATEGORY_VIDEO_DECODER_AV1_UHD_8BIT_30P, /**< 1094: video decoder for av1 */
+ RI_CATEGORY_VIDEO_DECODER_AV1_UHD_8BIT_60P, /**< 1095: video decoder for av1 */
+ RI_CATEGORY_VIDEO_DECODER_AV1_UHD_10BIT_30P, /**< 1096: video decoder for av1 */
+ RI_CATEGORY_VIDEO_DECODER_AV1_UHD_10BIT_60P, /**< 1097: video decoder for av1 */
+ RI_CATEGORY_VIDEO_DECODER_AV1_8K_8BIT_30P, /**< 1098: video decoder for av1 8k */
+ RI_CATEGORY_VIDEO_DECODER_AV1_8K_8BIT_60P, /**< 1099: video decoder for av1 8k */
+ RI_CATEGORY_VIDEO_DECODER_AV1_8K_10BIT_30P, /**< 1100: video decoder for av1 8k */
+ RI_CATEGORY_VIDEO_DECODER_AV1_8K_10BIT_60P, /**< 1101: video decoder for av1 8k */
+ RI_CATEGORY_VIDEO_DECODER_AV1_VR360_FHD_8BIT_30P, /**< 1102: video decoder for vp9 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_AV1_VR360_FHD_8BIT_60P, /**< 1103: video decoder for vp9 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_AV1_VR360_FHD_10BIT_30P, /**< 1104: video decoder for vp9 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_AV1_VR360_FHD_10BIT_60P, /**< 1105: video decoder for vp9 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_AV1_VR360_UHD_8BIT_30P, /**< 1106: video decoder for vp9 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_AV1_VR360_UHD_8BIT_60P, /**< 1107: video decoder for vp9 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_AV1_VR360_UHD_10BIT_30P, /**< 1108: video decoder for vp9 vr360 */
+ RI_CATEGORY_VIDEO_DECODER_AV1_VR360_UHD_10BIT_60P, /**< 1109: video decoder for vp9 vr360 */
+
+ RI_CATEGORY_VIDEO_DECODER_HEVC_FHD_8BIT_120P, /**< 1110: video decoder for hevc */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_FHD_10BIT_120P, /**< 1111: video decoder for hevc */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_FHD_10BIT_422_120P, /**< 1112: video decoder for hevc */
+ RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_120P, /**< 1113: video decoder for h264 */
+ RI_CATEGORY_VIDEO_DECODER_H264_HD_8BIT_30P, /**< 1114: video decoder for h264 */
+
+ RI_CATEGORY_VIDEO_DECODER_MPEG1_FHD_8BIT_120P, /**< 1115: video decoder for mpeg1 */
+ RI_CATEGORY_VIDEO_DECODER_MPEG2_FHD_8BIT_120P, /**< 1116: video decoder for mpeg2 */
+ RI_CATEGORY_VIDEO_DECODER_MPEG4_FHD_8BIT_120P, /**< 1117: video decoder for mpeg4 */
+ RI_CATEGORY_VIDEO_DECODER_H263_FHD_8BIT_120P, /**< 1118: video decoder for h263 */
+ RI_CATEGORY_VIDEO_DECODER_VP8_FHD_8BIT_120P, /**< 1119: video decoder for vp8 */
+ RI_CATEGORY_VIDEO_DECODER_VP9_FHD_8BIT_120P, /**< 1120: video decoder for vp9 */
+ RI_CATEGORY_VIDEO_DECODER_VP9_FHD_10BIT_120P, /**< 1121: video decoder for vp9 */
+ RI_CATEGORY_VIDEO_DECODER_RV_FHD_8BIT_120P, /**< 1122: video decoder for rv */
+ RI_CATEGORY_VIDEO_DECODER_WMV9_FHD_8BIT_120P, /**< 1123: video decoder for wmv9 */
+ RI_CATEGORY_VIDEO_DECODER_AVS_FHD_8BIT_120P, /**< 1124: video decoder for avs */
+ RI_CATEGORY_VIDEO_DECODER_AVS_PLUS_FHD_8BIT_120P, /**< 1125: video decoder for avs+ */
+ RI_CATEGORY_VIDEO_DECODER_AV1_FHD_8BIT_120P, /**< 1126: video decoder for av1 */
+ RI_CATEGORY_VIDEO_DECODER_AV1_FHD_10BIT_120P, /**< 1127: video decoder for av1 */
+
+ RI_CATEGORY_VIDEO_DECODER_AVS2_FHD_8BIT_30P, /**< 1128: video decoder for avs2 */
+ RI_CATEGORY_VIDEO_DECODER_AVS2_FHD_8BIT_60P, /**< 1129: video decoder for avs2 */
+ RI_CATEGORY_VIDEO_DECODER_AVS2_FHD_8BIT_120P, /**< 1130: video decoder for avs2 */
+ RI_CATEGORY_VIDEO_DECODER_AVS2_FHD_10BIT_30P, /**< 1131: video decoder for avs2 */
+ RI_CATEGORY_VIDEO_DECODER_AVS2_FHD_10BIT_60P, /**< 1132: video decoder for avs2 */
+ RI_CATEGORY_VIDEO_DECODER_AVS2_FHD_10BIT_120P, /**< 1133: video decoder for avs2 */
+
+ RI_CATEGORY_VIDEO_DECODER_AVS2_UHD_8BIT_30P, /**< 1134: video decoder for avs2 */
+ RI_CATEGORY_VIDEO_DECODER_AVS2_UHD_8BIT_60P, /**< 1135: video decoder for avs2 */
+ RI_CATEGORY_VIDEO_DECODER_AVS2_UHD_10BIT_30P, /**< 1136: video decoder for avs2 */
+ RI_CATEGORY_VIDEO_DECODER_AVS2_UHD_10BIT_60P, /**< 1137: video decoder for avs2 */
+
+ RI_CATEGORY_VIDEO_DECODER_VP9_FHD_10BIT_30P, /**< 1138: video decoder for vp9 */
+ RI_CATEGORY_VIDEO_DECODER_VP9_FHD_10BIT_60P, /**< 1139: video decoder for vp9 */
+ RI_CATEGORY_VIDEO_DECODER_VP9_UHD_10BIT_30P, /**< 1140: video decoder for vp9 */
+ RI_CATEGORY_VIDEO_DECODER_VP9_UHD_10BIT_60P, /**< 1141: video decoder for vp9 */
+
+ RI_CATEGORY_VIDEO_DECODER_AV1_UHD_8BIT_120P, /**< 1142: video decoder for av1 */
+ RI_CATEGORY_VIDEO_DECODER_AV1_UHD_10BIT_120P, /**< 1143: video decoder for av1 */
+ RI_CATEGORY_VIDEO_DECODER_VP8_qHD_8BIT_30P, /**< 1144: video decoder for vp8 */
+ RI_CATEGORY_VIDEO_DECODER_H264_FHD_N_8BIT_30P, /**< 1145: video decoder for h264 */
+ RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_30P_MV, /**< 1146: video decoder for h264 multiview scenario */
+ RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_60P_MV, /**< 1147: video decoder for h264 multiview scenario */
+ RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_30P_PORTRAIT, /**< 1148: video decoder for h264 portrait */
+ RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_60P_PORTRAIT, /**< 1149: video decoder for h264 portrait */
+ RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_30P_INTERLACED, /**< 1150: video decoder for h264 interlaced */
+ RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_60P_INTERLACED, /**< 1151: video decoder for h264 interlaced */
+ RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_30P_PROGRESSIVE,/**< 1152: video decoder dedicated to h264 progressive, support since version 4.0 */
+ RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_60P_PROGRESSIVE,/**< 1153: video decoder dedicated to h264 progressive, support since version 4.0 */
+ RI_CATEGORY_VIDEO_DECODER_H264_QuadHD_8BIT_30P, /**< 1154: video decoder for h264, support since version 4.0 */
+ RI_CATEGORY_VIDEO_DECODER_H264_QuadHD_8BIT_60P, /**< 1155: video decoder for h264, support since version 4.0 */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_DQHD_8BIT_30P, /**< 1156: video decoder for HEVC, support since version 4.0 */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_DQHD_8BIT_60P, /**< 1157: video decoder for HEVC, support since version 4.0 */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_DQHD_10BIT_30P, /**< 1158: video decoder for HEVC, support since version 4.0 */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_DQHD_10BIT_60P, /**< 1159: video decoder for HEVC, support since version 4.0 */
+ RI_CATEGORY_VIDEO_DECODER_AV1_DQHD_8BIT_30P, /**< 1160: video decoder for AV1, support since version 4.0 */
+ RI_CATEGORY_VIDEO_DECODER_AV1_DQHD_8BIT_60P, /**< 1161: video decoder for AV1, support since version 4.0 */
+ RI_CATEGORY_VIDEO_DECODER_AV1_DQHD_10BIT_30P, /**< 1162: video decoder for AV1, support since version 4.0 */
+ RI_CATEGORY_VIDEO_DECODER_AV1_DQHD_10BIT_60P, /**< 1163: video decoder for AV1, support since version 4.0 */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_5K_8BIT_30P, /**< 1164: video decoder for HEVC, support since version 5.3 */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_5K_8BIT_60P, /**< 1165: video decoder for HEVC, support since version 5.3 */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_5K_10BIT_30P, /**< 1166: video decoder for HEVC, support since version 5.3 */
+ RI_CATEGORY_VIDEO_DECODER_HEVC_5K_10BIT_60P, /**< 1167: video decoder for HEVC, support since version 5.3 */
+ RI_CATEGORY_VIDEO_DECODER_AV1_5K_8BIT_30P, /**< 1168: video decoder for AV1, support since version 5.3 */
+ RI_CATEGORY_VIDEO_DECODER_AV1_5K_8BIT_60P, /**< 1169: video decoder for AV1, support since version 5.3 */
+ RI_CATEGORY_VIDEO_DECODER_AV1_5K_10BIT_30P, /**< 1170: video decoder for AV1, support since version 5.3 */
+ RI_CATEGORY_VIDEO_DECODER_AV1_5K_10BIT_60P, /**< 1171: video decoder for AV1, support since version 5.3 */
+ RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_30P_TRIPLE, /**< 1172: video decoder for h264 triple decoding, support since version 5.4 */
+ RI_CATEGORY_VIDEO_DECODER_VVC_FHD_8BIT_30P, /**< 1173: video decoder for VVC(H.266), support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_VVC_FHD_8BIT_60P, /**< 1174: video decoder for VVC(H.266), support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_VVC_FHD_8BIT_120P, /**< 1175: video decoder for VVC(H.266), support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_VVC_FHD_10BIT_30P, /**< 1176: video decoder for VVC(H.266), support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_VVC_FHD_10BIT_60P, /**< 1177: video decoder for VVC(H.266), support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_VVC_FHD_10BIT_120P, /**< 1178: video decoder for VVC(H.266), support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_VVC_UHD_8BIT_30P, /**< 1179: video decoder for VVC(H.266), support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_VVC_UHD_8BIT_60P, /**< 1180: video decoder for VVC(H.266), support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_VVC_UHD_8BIT_120P, /**< 1181: video decoder for VVC(H.266), support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_VVC_UHD_10BIT_30P, /**< 1182: video decoder for VVC(H.266), support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_VVC_UHD_10BIT_60P, /**< 1183: video decoder for VVC(H.266), support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_VVC_UHD_10BIT_120P, /**< 1184: video decoder for VVC(H.266), support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_VVC_8K_8BIT_30P, /**< 1185: video decoder for VVC(H.266), support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_VVC_8K_8BIT_60P, /**< 1186: video decoder for VVC(H.266), support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_VVC_8K_10BIT_30P, /**< 1187: video decoder for VVC(H.266), support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_VVC_8K_10BIT_60P, /**< 1188: video decoder for VVC(H.266), support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_VP9_8K_8BIT_30P, /**< 1189: video decoder for VP9, support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_VP9_8K_8BIT_60P, /**< 1190: video decoder for VP9, support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_VP9_8K_10BIT_30P, /**< 1191: video decoder for VP9, support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_VP9_8K_10BIT_60P, /**< 1192: video decoder for VP9, support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_AVS3_FHD_8BIT_30P, /**< 1193: video decoder for AVS3, support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_AVS3_FHD_8BIT_60P, /**< 1194: video decoder for AVS3, support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_AVS3_FHD_8BIT_120P, /**< 1195: video decoder for AVS3, support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_AVS3_FHD_10BIT_30P, /**< 1196: video decoder for AVS3, support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_AVS3_FHD_10BIT_60P, /**< 1197: video decoder for AVS3, support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_AVS3_FHD_10BIT_120P, /**< 1198: video decoder for AVS3, support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_AVS3_UHD_8BIT_30P, /**< 1199: video decoder for AVS3, support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_AVS3_UHD_8BIT_60P, /**< 1200: video decoder for AVS3, support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_AVS3_UHD_8BIT_120P, /**< 1201: video decoder for AVS3, support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_AVS3_UHD_10BIT_30P, /**< 1202: video decoder for AVS3, support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_AVS3_UHD_10BIT_60P, /**< 1203: video decoder for AVS3, support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_AVS3_UHD_10BIT_120P, /**< 1204: video decoder for AVS3, support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_AVS3_8K_8BIT_30P, /**< 1205: video decoder for AVS3, support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_AVS3_8K_8BIT_60P, /**< 1206: video decoder for AVS3, support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_AVS3_8K_10BIT_30P, /**< 1207: video decoder for AVS3, support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_AVS3_8K_10BIT_60P, /**< 1208: video decoder for AVS3, support since version 6.0 */
+ RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_30P_DETILED, /**< 1209: video decoder for h264 detiled, support since version 6.4 */
+ RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_60P_DETILED /**< 1210: video decoder for h264 detiled, support since version 6.4 */
+} ri_rsc_category_e;
+
+#endif// __RI_CATEGORY_TYPE_H__
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#ifndef __RI_DUAL_DECODING_CAPABILITY_H__\r
-#define __RI_DUAL_DECODING_CAPABILITY_H__\r
-\r
-/**\r
-* @brief video property list\r
-*/\r
-struct ri_video_property_list;\r
-\r
-/**\r
-* @brief video property list handle\r
-*/\r
-typedef struct ri_video_property_list* ri_video_property_list_h;\r
-\r
-/**\r
-* @brief Create an empty video property list\r
-* @param None\r
-* @pre None\r
-* @post None\r
-* @exception None\r
-* @return Returns an empty video property list handle\r
-* @retval video property list handle on success\r
-* @retval NULL on failure\r
-* @remark the returned list should be freed by ri_video_property_list_free() after use.\r
-*/\r
-ri_video_property_list_h ri_create_video_property_list(void);\r
-\r
-/**\r
-* @brief Add a video property in the list\r
-* @param [in] list video property list\r
-* @param [in] property video property to add\r
-* @pre None\r
-* @post the property is added to the list\r
-* @exception None\r
-* @return Returns result of add\r
-* @retval 0 on success\r
-* @retval -1 on failure\r
-*/\r
-int ri_video_property_list_add(ri_video_property_list_h list, const ri_video_property_h property);\r
-\r
-/**\r
-* @brief Remove a video property in the list\r
-* @param [in] list video property list\r
-* @param [in] property video property to remove\r
-* @pre None\r
-* @post the property is removed from the list\r
-* @exception None\r
-* @return Returns result of remove\r
-* @retval 0 on success\r
-* @retval -1 on failure\r
-*/\r
-int ri_video_property_list_remove(ri_video_property_list_h list, const ri_video_property_h property);\r
-\r
-/**\r
-* @brief Free video property list\r
-* @param [in] list video property list handle\r
-* @pre None\r
-* @post all of video properties in the list are freed along with the list.\r
-* @exception None\r
-* @return None\r
-*/\r
-void ri_video_property_list_free(ri_video_property_list_h list);\r
-\r
-/**\r
-* @brief Check if video contents with video properties in order of high resolution video first included in the list can be played simultaneously.\r
-* @param [in] list video properties of video contents to play\r
-* @pre None\r
-* @post None\r
-* @exception None\r
-* @return Returns result\r
-* @retval true This model can play multiple video contents simultaneously in the list.\r
-* @retval false This model can't play multiple video contents simultaneously in the list.\r
-* @remark list should be freed by ri_video_property_list_free() after use.\r
-*/\r
-bool ri_can_play_multiple_videos(const ri_video_property_list_h list);\r
-\r
-#endif //__RI_VIDEO_CAPABILITY_H__\r
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#ifndef __RI_DUAL_DECODING_CAPABILITY_H__
+#define __RI_DUAL_DECODING_CAPABILITY_H__
+
+/**
+* @brief video property list
+*/
+struct ri_video_property_list;
+
+/**
+* @brief video property list handle
+*/
+typedef struct ri_video_property_list* ri_video_property_list_h;
+
+/**
+* @brief Create an empty video property list
+* @param None
+* @pre None
+* @post None
+* @exception None
+* @return Returns an empty video property list handle
+* @retval video property list handle on success
+* @retval NULL on failure
+* @remark the returned list should be freed by ri_video_property_list_free() after use.
+*/
+ri_video_property_list_h ri_create_video_property_list(void);
+
+/**
+* @brief Add a video property in the list
+* @param [in] list video property list
+* @param [in] property video property to add
+* @pre None
+* @post the property is added to the list
+* @exception None
+* @return Returns result of add
+* @retval 0 on success
+* @retval -1 on failure
+*/
+int ri_video_property_list_add(ri_video_property_list_h list, const ri_video_property_h property);
+
+/**
+* @brief Remove a video property in the list
+* @param [in] list video property list
+* @param [in] property video property to remove
+* @pre None
+* @post the property is removed from the list
+* @exception None
+* @return Returns result of remove
+* @retval 0 on success
+* @retval -1 on failure
+*/
+int ri_video_property_list_remove(ri_video_property_list_h list, const ri_video_property_h property);
+
+/**
+* @brief Free video property list
+* @param [in] list video property list handle
+* @pre None
+* @post all of video properties in the list are freed along with the list.
+* @exception None
+* @return None
+*/
+void ri_video_property_list_free(ri_video_property_list_h list);
+
+/**
+* @brief Check if video contents with video properties in order of high resolution video first included in the list can be played simultaneously.
+* @param [in] list video properties of video contents to play
+* @pre None
+* @post None
+* @exception None
+* @return Returns result
+* @retval true This model can play multiple video contents simultaneously in the list.
+* @retval false This model can't play multiple video contents simultaneously in the list.
+* @remark list should be freed by ri_video_property_list_free() after use.
+*/
+bool ri_can_play_multiple_videos(const ri_video_property_list_h list);
+
+#endif //__RI_VIDEO_CAPABILITY_H__
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#ifndef __RI_VDEC_API_H__\r
-#define __RI_VDEC_API_H__\r
-\r
-#include <ri-common-type.h>\r
-\r
-#ifdef __cplusplus\r
-extern "C"{\r
-#endif\r
-\r
-struct ri_resource_list;\r
-typedef struct ri_resource_list* ri_resource_list_h;\r
-\r
-struct ri_video_decoder;\r
-typedef struct ri_video_decoder* ri_video_decoder_h;\r
-\r
-struct ri_vcodec;\r
-typedef struct ri_vcodec* ri_video_codec_h;\r
-\r
-/**\r
- * @brief Get a video decoder list handle\r
- * @param[in] list video decoder list handle\r
- * @return 0 on success, otherwise negative value\r
- * @pre None\r
- * @post None\r
- * @exception None\r
- * @remark\r
- * \li The returned handle must be freed by ri_free_video_decoder_list() after use\r
- */\r
-int ri_get_video_decoder_list(ri_resource_list_h *list);\r
-\r
-/**\r
- * @brief Free a video decoder list handle\r
- * @param[in] list video decoder list handle\r
- * @return None\r
- * @pre None\r
- * @post None\r
- * @exception None\r
- */\r
-void ri_free_video_decoder_list(ri_resource_list_h list);\r
-\r
-/**\r
- * @brief Get next video decoder handle in the video decoder list\r
- * @param[in] list video decoder list handle\r
- * @return next video decoder handle\r
- * In case there is no next video decoder handle or error, returns NULL\r
- * @pre None\r
- * @post None\r
- * @exception None\r
- */\r
-ri_video_decoder_h ri_vdec_list_get_next(ri_resource_list_h list);\r
-\r
-/**\r
- * @brief Get previous video decoder handle in the video decoder list\r
- * @param[in] list video decoder list handle\r
- * @return previous video decoder handle\r
- * In case there is no previous video decoder handle or error, returns NULL\r
- * @pre None\r
- * @post None\r
- * @exception None\r
- */\r
-ri_video_decoder_h ri_vdec_list_get_prev(ri_resource_list_h list);\r
-\r
-/**\r
- * @brief Get first video decoder handle in the video decoder list\r
- * @param[in] list video decoder list handle\r
- * @return the first video decoder handle\r
- * In case there is no first video decoder handle (empty video decoder list) or error, returns NULL\r
- * @pre None\r
- * @post None\r
- * @exception None\r
- */\r
-ri_video_decoder_h ri_vdec_list_get_first(ri_resource_list_h list);\r
-\r
-/**\r
- * @brief Get last video decoder handle in the video decoder list\r
- * @param[in] list video decoder list handle\r
- * @return the last video decoder handle\r
- * In case there is no last video decoder handle (empty video decoder list) or error, returns NULL\r
- * @pre None\r
- * @post None\r
- * @exception None\r
- */\r
-ri_video_decoder_h ri_vdec_list_get_last(ri_resource_list_h list);\r
-\r
-/**\r
- * @brief Get number of video decoder handles in the video decoder list\r
- * @param[in] list video decoder list handle\r
- * @return number of video decoder handles in the video decoder list\r
- * @pre None\r
- * @post None\r
- * @exception None\r
- */\r
-int ri_vdec_list_get_count(ri_resource_list_h list);\r
-\r
-/**\r
- * @brief Get id of video decoder\r
- * @param[in] vdec video decoder handle\r
- * @return id of video decoder. Positive value on success, otherwise negative value\r
- * @pre None\r
- * @post None\r
- * @exception None\r
- */\r
-int ri_vdec_get_id(ri_video_decoder_h vdec);\r
-\r
-/**\r
- * @brief Get number of video codecs supported by video decoder\r
- * @param[in] vdec video decoder handle\r
- * @return number of the supported video codecs\r
- * @pre None\r
- * @post None\r
- * @exception None\r
- */\r
-int ri_vdec_get_supported_codec_count(ri_video_decoder_h vdec);\r
-\r
-/**\r
- * @brief Get next video codec handle in the video decoder\r
- * @param[in] vdec video decoder handle\r
- * @return next video codec handle\r
- * In case there is no next video codec handle or error, returns NULL\r
- * @pre None\r
- * @post None\r
- * @exception None\r
- */\r
-ri_video_codec_h ri_vdec_get_codec_next(ri_video_decoder_h vdec);\r
-\r
-/**\r
- * @brief Get previous video codec handle in the video decoder\r
- * @param[in] vdec video decoder handle\r
- * @return previous video codec handle\r
- * In case there is no previous video codec handle or error, returns NULL\r
- * @pre None\r
- * @post None\r
- * @exception None\r
- */\r
-ri_video_codec_h ri_vdec_get_codec_prev(ri_video_decoder_h vdec);\r
-\r
-/**\r
- * @brief Get first video codec handle in the video decoder\r
- * @param[in] vdec video decoder handle\r
- * @return the first video codec handle\r
- * In case there is no first video codec handle (empty video codec list) or error, returns NULL\r
- * @pre None\r
- * @post None\r
- * @exception None\r
- */\r
-ri_video_codec_h ri_vdec_get_codec_first(ri_video_decoder_h vdec);\r
-\r
-/**\r
- * @brief Get last video codec handle in the video decoder\r
- * @param[in] vdec video decoder handle\r
- * @return the last video codec handle\r
- * In case there is no last video codec handle (empty video codec list) or error, returns NULL\r
- * @pre None\r
- * @post None\r
- * @exception None\r
- */\r
-ri_video_codec_h ri_vdec_get_codec_last(ri_video_decoder_h vdec);\r
-\r
-/**\r
- * @brief Get video codec name\r
- * @param[in] vcodec video codec handle\r
- * @return video codec name\r
- * @pre None\r
- * @post None\r
- * @exception None\r
- * @remark\r
- * \li Please do not free() the returned pointer\r
- */\r
-const char* ri_vcodec_get_name(ri_video_codec_h vcodec);\r
-\r
-/**\r
- * @brief Get the supported max resolution for the codec\r
- * @param[in] vcodec video codec handle\r
- * @param[in] w width in pixel\r
- * @param[in] h height in pixel\r
- * @param[in] f framerate\r
- * @return 0 on success, otherwise negative value\r
- * @pre None\r
- * @post None\r
- * @exception None\r
- */\r
-int ri_vcodec_get_max_resolution(ri_video_codec_h vcodec, int* w, int* h, int *f);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif // __RI_VDEC_API_H__\r
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#ifndef __RI_VDEC_API_H__
+#define __RI_VDEC_API_H__
+
+#include <ri-common-type.h>
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+struct ri_resource_list;
+typedef struct ri_resource_list* ri_resource_list_h;
+
+struct ri_video_decoder;
+typedef struct ri_video_decoder* ri_video_decoder_h;
+
+struct ri_vcodec;
+typedef struct ri_vcodec* ri_video_codec_h;
+
+/**
+ * @brief Get a video decoder list handle
+ * @param[in] list video decoder list handle
+ * @return 0 on success, otherwise negative value
+ * @pre None
+ * @post None
+ * @exception None
+ * @remark
+ * \li The returned handle must be freed by ri_free_video_decoder_list() after use
+ */
+int ri_get_video_decoder_list(ri_resource_list_h *list);
+
+/**
+ * @brief Free a video decoder list handle
+ * @param[in] list video decoder list handle
+ * @return None
+ * @pre None
+ * @post None
+ * @exception None
+ */
+void ri_free_video_decoder_list(ri_resource_list_h list);
+
+/**
+ * @brief Get next video decoder handle in the video decoder list
+ * @param[in] list video decoder list handle
+ * @return next video decoder handle
+ * In case there is no next video decoder handle or error, returns NULL
+ * @pre None
+ * @post None
+ * @exception None
+ */
+ri_video_decoder_h ri_vdec_list_get_next(ri_resource_list_h list);
+
+/**
+ * @brief Get previous video decoder handle in the video decoder list
+ * @param[in] list video decoder list handle
+ * @return previous video decoder handle
+ * In case there is no previous video decoder handle or error, returns NULL
+ * @pre None
+ * @post None
+ * @exception None
+ */
+ri_video_decoder_h ri_vdec_list_get_prev(ri_resource_list_h list);
+
+/**
+ * @brief Get first video decoder handle in the video decoder list
+ * @param[in] list video decoder list handle
+ * @return the first video decoder handle
+ * In case there is no first video decoder handle (empty video decoder list) or error, returns NULL
+ * @pre None
+ * @post None
+ * @exception None
+ */
+ri_video_decoder_h ri_vdec_list_get_first(ri_resource_list_h list);
+
+/**
+ * @brief Get last video decoder handle in the video decoder list
+ * @param[in] list video decoder list handle
+ * @return the last video decoder handle
+ * In case there is no last video decoder handle (empty video decoder list) or error, returns NULL
+ * @pre None
+ * @post None
+ * @exception None
+ */
+ri_video_decoder_h ri_vdec_list_get_last(ri_resource_list_h list);
+
+/**
+ * @brief Get number of video decoder handles in the video decoder list
+ * @param[in] list video decoder list handle
+ * @return number of video decoder handles in the video decoder list
+ * @pre None
+ * @post None
+ * @exception None
+ */
+int ri_vdec_list_get_count(ri_resource_list_h list);
+
+/**
+ * @brief Get id of video decoder
+ * @param[in] vdec video decoder handle
+ * @return id of video decoder. Positive value on success, otherwise negative value
+ * @pre None
+ * @post None
+ * @exception None
+ */
+int ri_vdec_get_id(ri_video_decoder_h vdec);
+
+/**
+ * @brief Get number of video codecs supported by video decoder
+ * @param[in] vdec video decoder handle
+ * @return number of the supported video codecs
+ * @pre None
+ * @post None
+ * @exception None
+ */
+int ri_vdec_get_supported_codec_count(ri_video_decoder_h vdec);
+
+/**
+ * @brief Get next video codec handle in the video decoder
+ * @param[in] vdec video decoder handle
+ * @return next video codec handle
+ * In case there is no next video codec handle or error, returns NULL
+ * @pre None
+ * @post None
+ * @exception None
+ */
+ri_video_codec_h ri_vdec_get_codec_next(ri_video_decoder_h vdec);
+
+/**
+ * @brief Get previous video codec handle in the video decoder
+ * @param[in] vdec video decoder handle
+ * @return previous video codec handle
+ * In case there is no previous video codec handle or error, returns NULL
+ * @pre None
+ * @post None
+ * @exception None
+ */
+ri_video_codec_h ri_vdec_get_codec_prev(ri_video_decoder_h vdec);
+
+/**
+ * @brief Get first video codec handle in the video decoder
+ * @param[in] vdec video decoder handle
+ * @return the first video codec handle
+ * In case there is no first video codec handle (empty video codec list) or error, returns NULL
+ * @pre None
+ * @post None
+ * @exception None
+ */
+ri_video_codec_h ri_vdec_get_codec_first(ri_video_decoder_h vdec);
+
+/**
+ * @brief Get last video codec handle in the video decoder
+ * @param[in] vdec video decoder handle
+ * @return the last video codec handle
+ * In case there is no last video codec handle (empty video codec list) or error, returns NULL
+ * @pre None
+ * @post None
+ * @exception None
+ */
+ri_video_codec_h ri_vdec_get_codec_last(ri_video_decoder_h vdec);
+
+/**
+ * @brief Get video codec name
+ * @param[in] vcodec video codec handle
+ * @return video codec name
+ * @pre None
+ * @post None
+ * @exception None
+ * @remark
+ * \li Please do not free() the returned pointer
+ */
+const char* ri_vcodec_get_name(ri_video_codec_h vcodec);
+
+/**
+ * @brief Get the supported max resolution for the codec
+ * @param[in] vcodec video codec handle
+ * @param[in] w width in pixel
+ * @param[in] h height in pixel
+ * @param[in] f framerate
+ * @return 0 on success, otherwise negative value
+ * @pre None
+ * @post None
+ * @exception None
+ */
+int ri_vcodec_get_max_resolution(ri_video_codec_h vcodec, int* w, int* h, int *f);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __RI_VDEC_API_H__
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#ifndef __CIMAGE_CODEC_H__\r
-#define __CIMAGE_CODEC_H__\r
-\r
-#include <string>\r
-\r
-class CImageCodec {\r
-public:\r
- CImageCodec(std::string name);\r
- ~CImageCodec();\r
-\r
- void SetMaxResolution(int w, int h) { m_width_max = w, m_height_max = h; }\r
- void GetMaxResolution(int *w, int *h);\r
- void SetMinResolution(int w, int h) { m_width_min = w, m_height_min = h; }\r
- void GetMinResolution(int *w, int *h);\r
-\r
-private:\r
- std::string m_name;\r
- int m_width_max;\r
- int m_height_max;\r
- int m_width_min;\r
- int m_height_min;\r
-};\r
-\r
-#endif// __CIMAGE_CODEC_H__
\ No newline at end of file
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#ifndef __CIMAGE_CODEC_H__
+#define __CIMAGE_CODEC_H__
+
+#include <string>
+
+class CImageCodec {
+public:
+ CImageCodec(std::string name);
+ ~CImageCodec();
+
+ void SetMaxResolution(int w, int h) { m_width_max = w, m_height_max = h; }
+ void GetMaxResolution(int *w, int *h);
+ void SetMinResolution(int w, int h) { m_width_min = w, m_height_min = h; }
+ void GetMinResolution(int *w, int *h);
+
+private:
+ std::string m_name;
+ int m_width_max;
+ int m_height_max;
+ int m_width_min;
+ int m_height_min;
+};
+
+#endif// __CIMAGE_CODEC_H__
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#ifndef __CMODEL_INFO_H__\r
-#define __CMODEL_INFO_H__\r
-\r
-#include <string>\r
-#include <set>\r
-#include <map>\r
-\r
-typedef enum {\r
- CHIPSET_ERR = -1,\r
- CHIPSET_UNKNOWN = 0, /**< In case invalid SW Model is selected */\r
-} eChipSet;\r
-\r
-typedef enum {\r
- CHIPSET_VENDOR_OTHERS = 0,\r
- CHIPSET_VENDOR_SLSI\r
-} eChipSetVendor;\r
-\r
-class CModelInfo\r
-{\r
-public:\r
- static CModelInfo& GetInstance(void);\r
-\r
- CModelInfo();\r
- virtual ~CModelInfo() = default;\r
-\r
- virtual int GetResourceTableIndex(void) const;\r
- eChipSet GetChipSet(void);\r
-\r
- virtual bool IsEmulator(void) const;\r
- bool IsSingleTableModel(void) const;\r
- virtual bool SupportAndroidOnTizen(void) const;\r
-\r
-private:\r
- void InitFeatures(void);\r
- int ReadIndex(std::string filename) const;\r
- std::string GetChipSetName(void);\r
-\r
- bool m_has_dedicated_category_h264_fhd_portrait;\r
- bool m_exclusive_bw_for_h264_fhd_n_decoding;\r
-\r
- std::string m_chipset_name;\r
- std::map<std::string, eChipSet> m_chipset_info;\r
- std::map<std::string, eChipSetVendor> m_chipset_vendor; // chipset name, chipset vendor\r
-};\r
-\r
-#endif //__CMODEL_INFO_H__\r
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#ifndef __CMODEL_INFO_H__
+#define __CMODEL_INFO_H__
+
+#include <string>
+#include <set>
+#include <map>
+
+typedef enum {
+ CHIPSET_ERR = -1,
+ CHIPSET_UNKNOWN = 0, /**< In case invalid SW Model is selected */
+} eChipSet;
+
+typedef enum {
+ CHIPSET_VENDOR_OTHERS = 0,
+ CHIPSET_VENDOR_SLSI
+} eChipSetVendor;
+
+class CModelInfo
+{
+public:
+ static CModelInfo& GetInstance(void);
+
+ CModelInfo();
+ virtual ~CModelInfo() = default;
+
+ virtual int GetResourceTableIndex(void) const;
+ eChipSet GetChipSet(void);
+
+ virtual bool IsEmulator(void) const;
+ bool IsSingleTableModel(void) const;
+ virtual bool SupportAndroidOnTizen(void) const;
+
+private:
+ void InitFeatures(void);
+ int ReadIndex(std::string filename) const;
+ std::string GetChipSetName(void);
+
+ bool m_has_dedicated_category_h264_fhd_portrait;
+ bool m_exclusive_bw_for_h264_fhd_n_decoding;
+
+ std::string m_chipset_name;
+ std::map<std::string, eChipSet> m_chipset_info;
+ std::map<std::string, eChipSetVendor> m_chipset_vendor; // chipset name, chipset vendor
+};
+
+#endif //__CMODEL_INFO_H__
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#ifndef __CMULTIVIEW_H__\r
-#define __CMULTIVIEW_H__\r
-\r
-class CMultiview\r
-{\r
-public:\r
- static CMultiview& GetInstance(void);\r
-\r
- int GetStrategy(void) const { return strategy_; }\r
- bool RequireZoneBaseReclaim(void) const { return (reclaim_policy_ == ReclaimPolicy::ZoneBase); }\r
- bool SupportInterlacedPlaybackByMFDOnly(void) const { return (interlaced_playback_ == InterlacedPlayback::MFDOnly); }\r
- bool SupportSeamlessPlaybackByDVDEOnly(void) const { return (seamless_playback_ == SeamlessPlayback::DVDEOnly); }\r
- bool SupportDualDecodingAV1(void) const { return (av1_dual_decoding_ == AV1DualDecoding::Support); }\r
-\r
-private:\r
- enum class ReclaimPolicy {\r
- Default, /** Reclaim the oldest allocated resource first */\r
- ZoneBase /** Reclaim the resource allocated in same multiview zone first */\r
- };\r
-\r
- enum class InterlacedPlayback {\r
- All, /** All video decoders support the interlaced video playback for H264 */\r
- MFDOnly /** Only MFD decoder supports the interlaced video playback for H264 */\r
- };\r
-\r
- enum class SeamlessPlayback {\r
- All, /** All video decoders support the seamless playback (resolution change) in portrait mode */\r
- DVDEOnly /** Only DVDE decoder supports the seamless playback (resolution change) in portrait mode */\r
- };\r
-\r
- enum class AV1DualDecoding {\r
- Support, /** AV1 dual decoding is supported in multiview */\r
- NotSupport /** AV1 dual decoding is not supported in multiview */\r
- };\r
-\r
- CMultiview();\r
- ~CMultiview() = default;\r
-\r
- void Init(void);\r
- void SetPolicy(const int strategy, const ReclaimPolicy reclaim, const InterlacedPlayback interlaced, const SeamlessPlayback seamless, const AV1DualDecoding dual_decoding);\r
-\r
- int strategy_;\r
- ReclaimPolicy reclaim_policy_;\r
- InterlacedPlayback interlaced_playback_;\r
- SeamlessPlayback seamless_playback_;\r
- AV1DualDecoding av1_dual_decoding_;\r
-};\r
-\r
-#endif //__CMULTIVIEW_H__\r
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#ifndef __CMULTIVIEW_H__
+#define __CMULTIVIEW_H__
+
+class CMultiview
+{
+public:
+ static CMultiview& GetInstance(void);
+
+ int GetStrategy(void) const { return strategy_; }
+ bool RequireZoneBaseReclaim(void) const { return (reclaim_policy_ == ReclaimPolicy::ZoneBase); }
+ bool SupportInterlacedPlaybackByMFDOnly(void) const { return (interlaced_playback_ == InterlacedPlayback::MFDOnly); }
+ bool SupportSeamlessPlaybackByDVDEOnly(void) const { return (seamless_playback_ == SeamlessPlayback::DVDEOnly); }
+ bool SupportDualDecodingAV1(void) const { return (av1_dual_decoding_ == AV1DualDecoding::Support); }
+
+private:
+ enum class ReclaimPolicy {
+ Default, /** Reclaim the oldest allocated resource first */
+ ZoneBase /** Reclaim the resource allocated in same multiview zone first */
+ };
+
+ enum class InterlacedPlayback {
+ All, /** All video decoders support the interlaced video playback for H264 */
+ MFDOnly /** Only MFD decoder supports the interlaced video playback for H264 */
+ };
+
+ enum class SeamlessPlayback {
+ All, /** All video decoders support the seamless playback (resolution change) in portrait mode */
+ DVDEOnly /** Only DVDE decoder supports the seamless playback (resolution change) in portrait mode */
+ };
+
+ enum class AV1DualDecoding {
+ Support, /** AV1 dual decoding is supported in multiview */
+ NotSupport /** AV1 dual decoding is not supported in multiview */
+ };
+
+ CMultiview();
+ ~CMultiview() = default;
+
+ void Init(void);
+ void SetPolicy(const int strategy, const ReclaimPolicy reclaim, const InterlacedPlayback interlaced, const SeamlessPlayback seamless, const AV1DualDecoding dual_decoding);
+
+ int strategy_;
+ ReclaimPolicy reclaim_policy_;
+ InterlacedPlayback interlaced_playback_;
+ SeamlessPlayback seamless_playback_;
+ AV1DualDecoding av1_dual_decoding_;
+};
+
+#endif //__CMULTIVIEW_H__
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#ifndef __CResourceInfo_H__\r
-#define __CResourceInfo_H__\r
-\r
-#include <map>\r
-\r
-#include <ri-category-type.h>\r
-#include <ri-video-decoder-category-type.h>\r
-\r
-class CResourceInfo\r
-{\r
-public:\r
- CResourceInfo();\r
- ~CResourceInfo();\r
-\r
- static CResourceInfo* GetInstance(void);\r
- ri_rsc_category_e GetVideoCategoryID(const char *codec_name, int color_depth, int h_size, int framerate, int sampling_format);\r
- ri_rsc_category_e GetCapableVideoCategoryID(ri_video_category_option_request_s* option, bool n_decoding);\r
- ri_rsc_category_e GetCapableVideoCategoryID(ri_video_property *prop, bool n_decoding);\r
- ri_rsc_category_e GetCapableMJpegDecoderCategoryID(const char *codec_name, int h_size);\r
- ri_rsc_category_e GetSubJpegCategoryID(const char *codec_name, int w_size, int h_size);\r
- ri_rsc_category_e GetHEICCategoryID(const char *codec_name, int w_size, int h_size);\r
- ri_rsc_category_e GetImageCategoryID(const char *codec_name, int w_size, int h_size);\r
- int GetCapableAudioDecoderCategoryID(ri_audio_category_option_request_s* option);\r
-\r
-private:\r
- static CResourceInfo* m_instance;\r
-\r
- ri_color_depth GetColorDepthID(int color_depth, int sampling_format);\r
- ri_framerate GetFrameRateID(int framerate);\r
- ri_resolution GetResolutionID(int resolution);\r
- ri_resolution GetResolutionID(int width, int height, bool n_decoding, std::string codec_name);\r
- ri_resolution GetResolutionID(const std::string codec_name, const int w, const int h);\r
- ri_resolution GetImageResolutionID(std::string codec, int w, int h);\r
- ri_rsc_category_e GetCapableVideoCategoryID(std::string codec_name, int width, int height, int framerate, int sampling_format, int color_depth, bool n_decoding);\r
- int ToPortraitCategory(int category);\r
- bool IsValidImageResolution(std::string codec, int w, int h);\r
- int GetMixingOption(ri_audio_mixing_mode mixing_mode);\r
- void ConstructSupportedVideoFormat(void);\r
- bool IsNormalMode(void);\r
- bool NeedDedicatedCategoryH264Portrait(std::string codec_name, int w, int h);\r
- ri_rsc_category_e ToCategoryDedicatedToProgressive(ri_rsc_category_e category_id);\r
- ri_rsc_category_e ToCategoryDedicatedToDetiled(ri_rsc_category_e category_id);\r
-};\r
-\r
-#endif //__CResourceInfo_H__\r
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#ifndef __CResourceInfo_H__
+#define __CResourceInfo_H__
+
+#include <map>
+
+#include <ri-category-type.h>
+#include <ri-video-decoder-category-type.h>
+
+class CResourceInfo
+{
+public:
+ CResourceInfo();
+ ~CResourceInfo();
+
+ static CResourceInfo* GetInstance(void);
+ ri_rsc_category_e GetVideoCategoryID(const char *codec_name, int color_depth, int h_size, int framerate, int sampling_format);
+ ri_rsc_category_e GetCapableVideoCategoryID(ri_video_category_option_request_s* option, bool n_decoding);
+ ri_rsc_category_e GetCapableVideoCategoryID(ri_video_property *prop, bool n_decoding);
+ ri_rsc_category_e GetCapableMJpegDecoderCategoryID(const char *codec_name, int h_size);
+ ri_rsc_category_e GetSubJpegCategoryID(const char *codec_name, int w_size, int h_size);
+ ri_rsc_category_e GetHEICCategoryID(const char *codec_name, int w_size, int h_size);
+ ri_rsc_category_e GetImageCategoryID(const char *codec_name, int w_size, int h_size);
+ int GetCapableAudioDecoderCategoryID(ri_audio_category_option_request_s* option);
+
+private:
+ static CResourceInfo* m_instance;
+
+ ri_color_depth GetColorDepthID(int color_depth, int sampling_format);
+ ri_framerate GetFrameRateID(int framerate);
+ ri_resolution GetResolutionID(int resolution);
+ ri_resolution GetResolutionID(int width, int height, bool n_decoding, std::string codec_name);
+ ri_resolution GetResolutionID(const std::string codec_name, const int w, const int h);
+ ri_resolution GetImageResolutionID(std::string codec, int w, int h);
+ ri_rsc_category_e GetCapableVideoCategoryID(std::string codec_name, int width, int height, int framerate, int sampling_format, int color_depth, bool n_decoding);
+ int ToPortraitCategory(int category);
+ bool IsValidImageResolution(std::string codec, int w, int h);
+ int GetMixingOption(ri_audio_mixing_mode mixing_mode);
+ void ConstructSupportedVideoFormat(void);
+ bool IsNormalMode(void);
+ bool NeedDedicatedCategoryH264Portrait(std::string codec_name, int w, int h);
+ ri_rsc_category_e ToCategoryDedicatedToProgressive(ri_rsc_category_e category_id);
+ ri_rsc_category_e ToCategoryDedicatedToDetiled(ri_rsc_category_e category_id);
+};
+
+#endif //__CResourceInfo_H__
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#ifndef _RESOURCE_INFO_DB_H_\r
-#define _RESOURCE_INFO_DB_H_\r
-\r
-#include <map>\r
-#include <vector>\r
-#include <set>\r
-#include <string>\r
-#include <stdlib.h>\r
-#include <string.h>\r
-#include <pthread.h>\r
-#include <glib.h>\r
-\r
-#include <ri-common-type.h>\r
-#include <ri-module-api.h>\r
-#include <ri-vdec-api.h>\r
-#include <ri-type.h>\r
-#include <ri-debug.h>\r
-#include <CVideoCodec.h>\r
-#include <CVideoCodecNDecoding.h>\r
-#include <CVideoDecoder.h>\r
-#include <CImageCodec.h>\r
-#include <CVideoDecoderCategory.h>\r
-#include <CCategoryIdBuilder.h>\r
-#include <CVideoCapability.h>\r
-\r
-class CategoryElement;\r
-\r
-class CResourceInfoDB\r
-{\r
-public:\r
- CResourceInfoDB();\r
- ~CResourceInfoDB();\r
- static CResourceInfoDB* GetInstance(void);\r
-\r
- ri_rsc_category_e IsSupportedVideoFormat(ri_rsc_category_e decoder_id);\r
- ri_rsc_category_e IsNDecodingSupportedVideoFormat(ri_rsc_category_e decoder_id);\r
- ri_rsc_category_e IsSupportedJpegFormat(ri_rsc_category_e decoder_id);\r
- ri_rsc_category_e IsSupportedMJpegFormat(ri_rsc_category_e decoder_id);\r
- ri_rsc_category_e IsSupportedImageFormat(ri_rsc_category_e category_id);\r
- bool IsSupportedAudioCodec(std::string acodec);\r
-\r
- void AddSupportedVideoFormat(ri_rsc_category_e decoder_id);\r
- void AddSupportedJpegFormat(ri_rsc_category_e decoder_id);\r
- void AddSupportedAudioCodec(std::string name, ri_rsc_category_e decoder_id);\r
- void AddSupportedNDecoder(ri_rsc_category_e decoder_id);\r
- void AddSupportedNDecoder(std::string codec_name, ri_rsc_category_e category_id, int rsz, int framerate);\r
- void AddVideoCodec(std::string name, int resolution, int framerate);\r
- void AddSupportedImageFormat(ri_rsc_category_e decoder_id);\r
- void AddCategoryResolution(ri_rsc_category_e category_id, int resolution);\r
- void AddCategoryFramerate(ri_rsc_category_e category_id, int framerate);\r
- void AddVideoDecoder(int id, std::string codec_name, int rsz, int framerate);\r
- int FindCategoryResolution(int category_id);\r
- int FindCategoryFramerate(int category_id);\r
- std::string FindCategoryVideoCodecName(int category_id);\r
- int GetNumOfDeviceBelongsTo(int category_id);\r
- void AddCategoryInfo(IN ri_resource_category_s* category);\r
- void AddDeviceAttributes(IN ri_device_common_attr_s* device_attr);\r
- void AddDeviceUniqueAttributes(IN const int id_unique, IN ri_device_unique_attr_s* device_attr);\r
- bool HasDeviceUniqueAttributes(const int id_unique);\r
-\r
- int Set2KSize(std::string codec_name, int w, int h, int wp, int hp);\r
- int Set4KSize(std::string codec_name, int w, int h, int wp, int hp);\r
- int Set8KSize(std::string codec_name, int w, int h, int wp, int hp);\r
-\r
- unsigned int GetDeviceID(char *node);\r
- int GetDeviceID(unsigned int category, unsigned int device_sz, int *device_id);\r
- int GetAIDecoderCategoryId(ri_rsc_category_e vdec);\r
- int GetVideoDecCategoryId(std::string codec_name, int rsz_id, int framerate, int color_depth);\r
-\r
- const char *GetDeviceName(IN const int device_id);\r
- ri_return_code_e GetOmxCompName(const int device_id, char** name);\r
- ri_return_code_e GetDeviceNodePath(IN const int device_id, OUT char** device_path);\r
- ri_return_code_e GetDefaultDeviceNodePath(ri_rsc_category_e category, char** node); //for fastboot\r
- ri_return_code_e GetCategoryType(IN int device_id, OUT int* category_type);\r
- ri_return_code_e GetCategoryOption(const char *codec, ri_video_decoder_class_e class_value, int* category_option, bool* is_uhd_decoder, char** device_node); \r
- ri_return_code_e GetDeviceList(OUT int* num, OUT ri_device_common_attr_s** devices);\r
- ri_rsc_category_e GetAudioDecoderCategoryId(const char *codec_name);\r
- int GetCategoryClass(int category_id);\r
- int GetMainCategory(IN int device_id);\r
- CVideoCodec* FindVideoCodec(std::string name);\r
- CVideoCodecNDecoding *FindNDecodingVideoCodec(std::string codec_name);\r
-\r
- bool IsSupportTripleDecoding(void) {return (m_vdecs >= 3);}\r
- bool IsMainDevice(const int device_id);\r
-\r
- int GetSystemBW(void){return m_system_bw;}\r
- void SetSystemBW(int bw){m_system_bw = bw;}\r
- void SetMaxVideoDecoderNum(int n_vdecs) { m_vdecs = n_vdecs; }\r
- int GetMaxVideoDecoderNum(void) { return m_vdecs; }\r
- void SetImageMinMaxResolution(std::string codec, int w_min, int h_min, int w_max, int h_max);\r
- void GetImageMinMaxResolution(std::string codec, int *w_min, int *h_min, int *w_max, int *h_max);\r
- bool IsVideoDecoderCategory(ri_rsc_category_e vdec);\r
- bool IsAudioDecoderCategory(ri_rsc_category_e adec);\r
- bool IsAudioDecoderCategoryForMixing(ri_rsc_category_e adec);\r
- bool IsMJpegDecoderCategory(ri_rsc_category_e category);\r
- void PrintDeviceUniqueInfo(void);\r
-\r
- bool IsSupportOverlay(const int device_id);\r
- int GetMaxResolution(const int device_id);\r
- int GetMaxSamplingFormat(const int device_id);\r
- int GetVideoDecoderList(ri_resource_list_h *list_out);\r
-\r
- int ToNDecodingCategory(int category);\r
- bool Support2KPortraitResolution(std::string codec_name);\r
- bool IsSupportedCategory(int category);\r
-\r
- void AddVideoCapability(const std::string codec, VideoCapability *capability);\r
- bool FindVideoCapability(const std::string codec, std::vector<VideoCapability *> &capabilities);\r
- ri_device_common_attr_s *GetDeviceAttr(int device_id);\r
-\r
-private:\r
- static CResourceInfoDB* m_instance;\r
-\r
- std::map<int, ri_resource_category_s*> m_resource_categories;\r
- std::map<int, ri_device_common_attr_s*> m_device_attr_map_by_dev_id;\r
- std::map<int, ri_device_common_attr_s*> m_scalers;\r
- std::map<int, ri_device_unique_attr_s*> m_device_unique_attr;\r
- std::map<std::string, ri_rsc_category_e> m_supported_audio_codecs;\r
- std::map<int, int> m_category_resolution; // category id, resolution id\r
- std::map<int, int> m_category_framerate; // category id, framerate\r
- std::set<int> m_supported_video_format;\r
- std::set<int> m_n_decoding_supported_video_format;\r
- std::set<int> m_supported_jpeg_format;\r
- std::set<int> m_supported_image_format;\r
- std::map<std::string, CVideoCodec *> m_video_codecs;\r
- std::map<std::string, CVideoCodecNDecoding *> m_n_decoding_codecs;\r
- std::map<std::string, CVideoDecoderCategory *> m_video_dec_categories;\r
- std::map<std::string, CImageCodec*> m_image_codecs;\r
- std::map<int, CVideoDecoder *> m_video_decoders;\r
- std::map<std::string, std::vector<VideoCapability *>> video_capabilities_;\r
-\r
- int m_system_bw;\r
- int m_vdecs;\r
- int m_n_scalers;\r
-\r
- bool GetDeviceNodePathNames(int category, char** device_node);\r
- bool GetClassOptions(const char *codec, ri_video_decoder_class_e class_value, bool *is_uhd_decoder, int *class_cat, bool *is_class_uhd, char **class_device_node);\r
- std::string GetDeviceNodePathScaler(const int device_id);\r
- std::string GetDeviceNameScaler(const int device_id);\r
- bool IsSubTunerSupported(int dtv_type);\r
- bool IsVirtualDeviceIdScaler(int device_id);\r
- bool IsScaler(int category);\r
- void InitVideoDecCategories(void);\r
- bool IsCodecSupporting2KPortrait(std::string codec_name);\r
- CCategoryIdBuilder* GetVideoDecCategoryBuilder(std::string codec_name);\r
-};\r
-#endif //_RESOURCE_INFO_DB_H_\r
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#ifndef _RESOURCE_INFO_DB_H_
+#define _RESOURCE_INFO_DB_H_
+
+#include <map>
+#include <vector>
+#include <set>
+#include <string>
+#include <stdlib.h>
+#include <string.h>
+#include <pthread.h>
+#include <glib.h>
+
+#include <ri-common-type.h>
+#include <ri-module-api.h>
+#include <ri-vdec-api.h>
+#include <ri-type.h>
+#include <ri-debug.h>
+#include <CVideoCodec.h>
+#include <CVideoCodecNDecoding.h>
+#include <CVideoDecoder.h>
+#include <CImageCodec.h>
+#include <CVideoDecoderCategory.h>
+#include <CCategoryIdBuilder.h>
+#include <CVideoCapability.h>
+
+class CategoryElement;
+
+class CResourceInfoDB
+{
+public:
+ CResourceInfoDB();
+ ~CResourceInfoDB();
+ static CResourceInfoDB* GetInstance(void);
+
+ ri_rsc_category_e IsSupportedVideoFormat(ri_rsc_category_e decoder_id);
+ ri_rsc_category_e IsNDecodingSupportedVideoFormat(ri_rsc_category_e decoder_id);
+ ri_rsc_category_e IsSupportedJpegFormat(ri_rsc_category_e decoder_id);
+ ri_rsc_category_e IsSupportedMJpegFormat(ri_rsc_category_e decoder_id);
+ ri_rsc_category_e IsSupportedImageFormat(ri_rsc_category_e category_id);
+ bool IsSupportedAudioCodec(std::string acodec);
+
+ void AddSupportedVideoFormat(ri_rsc_category_e decoder_id);
+ void AddSupportedJpegFormat(ri_rsc_category_e decoder_id);
+ void AddSupportedAudioCodec(std::string name, ri_rsc_category_e decoder_id);
+ void AddSupportedNDecoder(ri_rsc_category_e decoder_id);
+ void AddSupportedNDecoder(std::string codec_name, ri_rsc_category_e category_id, int rsz, int framerate);
+ void AddVideoCodec(std::string name, int resolution, int framerate);
+ void AddSupportedImageFormat(ri_rsc_category_e decoder_id);
+ void AddCategoryResolution(ri_rsc_category_e category_id, int resolution);
+ void AddCategoryFramerate(ri_rsc_category_e category_id, int framerate);
+ void AddVideoDecoder(int id, std::string codec_name, int rsz, int framerate);
+ int FindCategoryResolution(int category_id);
+ int FindCategoryFramerate(int category_id);
+ std::string FindCategoryVideoCodecName(int category_id);
+ int GetNumOfDeviceBelongsTo(int category_id);
+ void AddCategoryInfo(IN ri_resource_category_s* category);
+ void AddDeviceAttributes(IN ri_device_common_attr_s* device_attr);
+ void AddDeviceUniqueAttributes(IN const int id_unique, IN ri_device_unique_attr_s* device_attr);
+ bool HasDeviceUniqueAttributes(const int id_unique);
+
+ int Set2KSize(std::string codec_name, int w, int h, int wp, int hp);
+ int Set4KSize(std::string codec_name, int w, int h, int wp, int hp);
+ int Set8KSize(std::string codec_name, int w, int h, int wp, int hp);
+
+ unsigned int GetDeviceID(char *node);
+ int GetDeviceID(unsigned int category, unsigned int device_sz, int *device_id);
+ int GetAIDecoderCategoryId(ri_rsc_category_e vdec);
+ int GetVideoDecCategoryId(std::string codec_name, int rsz_id, int framerate, int color_depth);
+
+ const char *GetDeviceName(IN const int device_id);
+ ri_return_code_e GetOmxCompName(const int device_id, char** name);
+ ri_return_code_e GetDeviceNodePath(IN const int device_id, OUT char** device_path);
+ ri_return_code_e GetDefaultDeviceNodePath(ri_rsc_category_e category, char** node); //for fastboot
+ ri_return_code_e GetCategoryType(IN int device_id, OUT int* category_type);
+ ri_return_code_e GetCategoryOption(const char *codec, ri_video_decoder_class_e class_value, int* category_option, bool* is_uhd_decoder, char** device_node);
+ ri_return_code_e GetDeviceList(OUT int* num, OUT ri_device_common_attr_s** devices);
+ ri_rsc_category_e GetAudioDecoderCategoryId(const char *codec_name);
+ int GetCategoryClass(int category_id);
+ int GetMainCategory(IN int device_id);
+ CVideoCodec* FindVideoCodec(std::string name);
+ CVideoCodecNDecoding *FindNDecodingVideoCodec(std::string codec_name);
+
+ bool IsSupportTripleDecoding(void) {return (m_vdecs >= 3);}
+ bool IsMainDevice(const int device_id);
+
+ int GetSystemBW(void){return m_system_bw;}
+ void SetSystemBW(int bw){m_system_bw = bw;}
+ void SetMaxVideoDecoderNum(int n_vdecs) { m_vdecs = n_vdecs; }
+ int GetMaxVideoDecoderNum(void) { return m_vdecs; }
+ void SetImageMinMaxResolution(std::string codec, int w_min, int h_min, int w_max, int h_max);
+ void GetImageMinMaxResolution(std::string codec, int *w_min, int *h_min, int *w_max, int *h_max);
+ bool IsVideoDecoderCategory(ri_rsc_category_e vdec);
+ bool IsAudioDecoderCategory(ri_rsc_category_e adec);
+ bool IsAudioDecoderCategoryForMixing(ri_rsc_category_e adec);
+ bool IsMJpegDecoderCategory(ri_rsc_category_e category);
+ void PrintDeviceUniqueInfo(void);
+
+ bool IsSupportOverlay(const int device_id);
+ int GetMaxResolution(const int device_id);
+ int GetMaxSamplingFormat(const int device_id);
+ int GetVideoDecoderList(ri_resource_list_h *list_out);
+
+ int ToNDecodingCategory(int category);
+ bool Support2KPortraitResolution(std::string codec_name);
+ bool IsSupportedCategory(int category);
+
+ void AddVideoCapability(const std::string codec, VideoCapability *capability);
+ bool FindVideoCapability(const std::string codec, std::vector<VideoCapability *> &capabilities);
+ ri_device_common_attr_s *GetDeviceAttr(int device_id);
+
+private:
+ static CResourceInfoDB* m_instance;
+
+ std::map<int, ri_resource_category_s*> m_resource_categories;
+ std::map<int, ri_device_common_attr_s*> m_device_attr_map_by_dev_id;
+ std::map<int, ri_device_common_attr_s*> m_scalers;
+ std::map<int, ri_device_unique_attr_s*> m_device_unique_attr;
+ std::map<std::string, ri_rsc_category_e> m_supported_audio_codecs;
+ std::map<int, int> m_category_resolution; // category id, resolution id
+ std::map<int, int> m_category_framerate; // category id, framerate
+ std::set<int> m_supported_video_format;
+ std::set<int> m_n_decoding_supported_video_format;
+ std::set<int> m_supported_jpeg_format;
+ std::set<int> m_supported_image_format;
+ std::map<std::string, CVideoCodec *> m_video_codecs;
+ std::map<std::string, CVideoCodecNDecoding *> m_n_decoding_codecs;
+ std::map<std::string, CVideoDecoderCategory *> m_video_dec_categories;
+ std::map<std::string, CImageCodec*> m_image_codecs;
+ std::map<int, CVideoDecoder *> m_video_decoders;
+ std::map<std::string, std::vector<VideoCapability *>> video_capabilities_;
+
+ int m_system_bw;
+ int m_vdecs;
+ int m_n_scalers;
+
+ bool GetDeviceNodePathNames(int category, char** device_node);
+ bool GetClassOptions(const char *codec, ri_video_decoder_class_e class_value, bool *is_uhd_decoder, int *class_cat, bool *is_class_uhd, char **class_device_node);
+ std::string GetDeviceNodePathScaler(const int device_id);
+ std::string GetDeviceNameScaler(const int device_id);
+ bool IsSubTunerSupported(int dtv_type);
+ bool IsVirtualDeviceIdScaler(int device_id);
+ bool IsScaler(int category);
+ void InitVideoDecCategories(void);
+ bool IsCodecSupporting2KPortrait(std::string codec_name);
+ CCategoryIdBuilder* GetVideoDecCategoryBuilder(std::string codec_name);
+};
+#endif //_RESOURCE_INFO_DB_H_
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#ifndef __CVIDEO_CODEC_H__\r
-#define __CVIDEO_CODEC_H__\r
-\r
-#include <string>\r
-#include <memory>\r
-#include <set>\r
-#include <map>\r
-#include <ri-video-decoder-category-type.h>\r
-#include <CVideoResolution.h>\r
-\r
-class CVideoCodec\r
-{\r
-public:\r
- CVideoCodec(const std::string name, const unsigned int resolution, const int fps, const bool support_2k_portrait);\r
- ~CVideoCodec() = default;\r
-\r
- std::string GetName(void) const { return name_; }\r
-\r
- void CreateExtraResolution(const unsigned int resolution);\r
- void SetResolutionSize(const unsigned int resolution, const int w, const int h, const int wp, const int hp);\r
- void SetMaxResolution(const unsigned int resolution) { max_resolution_ = resolution; }\r
- void SetMaxFrameRate(const int fps) { max_fps_ = fps; }\r
- int GetMaxResolution(void) const { return max_resolution_; }\r
- int GetMaxFrameRate(void) const { return max_fps_; }\r
-\r
- ri_resolution GetResolutionID(const int w, const int h) const;\r
- bool IsSizeNotSupportedByFHDDecoder(const int resolution, const int w, const int h) const;\r
- bool Support2KPortraitResolution(void) const { return support_2k_portrait_; }\r
-\r
-private:\r
- void InitResolutions(void);\r
- std::shared_ptr<CVideoResolution> FindResolution(const unsigned int resolution) const;\r
-\r
- std::string name_;\r
- unsigned int max_resolution_;\r
- int max_fps_;\r
- bool support_2k_portrait_;\r
- bool vr360_codec_;\r
- std::map<unsigned int, std::shared_ptr<CVideoResolution>> resolutions_;\r
- const std::set<std::string> vr360_codecs_ = {\r
- RI_CODEC_NAME_HEVC_VR360,\r
- RI_CODEC_NAME_H264_VR360,\r
- RI_CODEC_NAME_VP9_VR360,\r
- RI_CODEC_NAME_AV1_VR360\r
- };\r
-};\r
-\r
-#endif// __CVIDEO_CODEC_H__\r
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#ifndef __CVIDEO_CODEC_H__
+#define __CVIDEO_CODEC_H__
+
+#include <string>
+#include <memory>
+#include <set>
+#include <map>
+#include <ri-video-decoder-category-type.h>
+#include <CVideoResolution.h>
+
+class CVideoCodec
+{
+public:
+ CVideoCodec(const std::string name, const unsigned int resolution, const int fps, const bool support_2k_portrait);
+ ~CVideoCodec() = default;
+
+ std::string GetName(void) const { return name_; }
+
+ void CreateExtraResolution(const unsigned int resolution);
+ void SetResolutionSize(const unsigned int resolution, const int w, const int h, const int wp, const int hp);
+ void SetMaxResolution(const unsigned int resolution) { max_resolution_ = resolution; }
+ void SetMaxFrameRate(const int fps) { max_fps_ = fps; }
+ int GetMaxResolution(void) const { return max_resolution_; }
+ int GetMaxFrameRate(void) const { return max_fps_; }
+
+ ri_resolution GetResolutionID(const int w, const int h) const;
+ bool IsSizeNotSupportedByFHDDecoder(const int resolution, const int w, const int h) const;
+ bool Support2KPortraitResolution(void) const { return support_2k_portrait_; }
+
+private:
+ void InitResolutions(void);
+ std::shared_ptr<CVideoResolution> FindResolution(const unsigned int resolution) const;
+
+ std::string name_;
+ unsigned int max_resolution_;
+ int max_fps_;
+ bool support_2k_portrait_;
+ bool vr360_codec_;
+ std::map<unsigned int, std::shared_ptr<CVideoResolution>> resolutions_;
+ const std::set<std::string> vr360_codecs_ = {
+ RI_CODEC_NAME_HEVC_VR360,
+ RI_CODEC_NAME_H264_VR360,
+ RI_CODEC_NAME_VP9_VR360,
+ RI_CODEC_NAME_AV1_VR360
+ };
+};
+
+#endif// __CVIDEO_CODEC_H__
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#ifndef __CVideoCodecNDecoding_H__\r
-#define __CVideoCodecNDecoding_H__\r
-#include <string>\r
-\r
-class CVideoCodecNDecoding\r
-{\r
-public:\r
- CVideoCodecNDecoding(std::string codec_name, int rsz, int framerate):m_name(codec_name), m_max_rsz(rsz), m_max_fps(framerate) { }\r
- ~CVideoCodecNDecoding() = default;\r
-\r
- void SetMaxResolution(int rsz) { m_max_rsz = rsz; }\r
- int GetMaxResolution(void) { return m_max_rsz; }\r
- void SetMaxFramerate(int framerate) { m_max_fps = framerate; }\r
- int GetMaxFramerate(void) { return m_max_fps; }\r
- void SetCategoryId(int category_id) { m_category_id = category_id; }\r
- int GetCategoryId(void) { return m_category_id; }\r
-\r
-private:\r
- std::string m_name;\r
- int m_max_rsz;\r
- int m_max_fps;\r
- int m_category_id;\r
-};\r
-#endif //__CVideoCodecNDecoding_H__
\ No newline at end of file
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#ifndef __CVideoCodecNDecoding_H__
+#define __CVideoCodecNDecoding_H__
+#include <string>
+
+class CVideoCodecNDecoding
+{
+public:
+ CVideoCodecNDecoding(std::string codec_name, int rsz, int framerate):m_name(codec_name), m_max_rsz(rsz), m_max_fps(framerate) { }
+ ~CVideoCodecNDecoding() = default;
+
+ void SetMaxResolution(int rsz) { m_max_rsz = rsz; }
+ int GetMaxResolution(void) { return m_max_rsz; }
+ void SetMaxFramerate(int framerate) { m_max_fps = framerate; }
+ int GetMaxFramerate(void) { return m_max_fps; }
+ void SetCategoryId(int category_id) { m_category_id = category_id; }
+ int GetCategoryId(void) { return m_category_id; }
+
+private:
+ std::string m_name;
+ int m_max_rsz;
+ int m_max_fps;
+ int m_category_id;
+};
+#endif //__CVideoCodecNDecoding_H__
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#ifndef __CVIDEO_RESOLUTION_H__\r
-#define __CVIDEO_RESOLUTION_H__\r
-\r
-#include <memory>\r
-\r
-class CVideoResolution\r
-{\r
-public:\r
- CVideoResolution(const unsigned int resolution);\r
- ~CVideoResolution() = default;\r
-\r
- void SetSize(const int w, const int h, const int wp, const int hp);\r
- std::string GetSizeString(void) const;\r
-\r
- bool SupportedSize(const int w, const int h) const;\r
- bool SupportedSizeVR360(const int w, const int h) const;\r
- bool SupportedSizeByFHDDecoder(const int w, const int h) const;\r
-\r
- int GetWidth(void) const { return w_; }\r
- int GetHeight(void) const { return h_; }\r
- int GetWidthPortrait(void) const { return wp_; }\r
- int GetHeightPortrait(void) const { return hp_; }\r
-\r
- static void GetResolutionSize(const unsigned int resolution, int *w, int *h);\r
-\r
-private:\r
- bool LandScapeSize(const int w, const int h) const { return (w >= h) ? true:false; }\r
- static bool ValidResolution(const unsigned int resolution);\r
- static void GetDefaultSize(const unsigned int resolution, int *w, int *h, int *wp, int *hp);\r
-\r
- unsigned int resolution_;\r
- int w_;\r
- int h_;\r
- int wp_;\r
- int hp_;\r
-};\r
-\r
-#endif //__CVIDEO_RESOLUTION_H__
\ No newline at end of file
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#ifndef __CVIDEO_RESOLUTION_H__
+#define __CVIDEO_RESOLUTION_H__
+
+#include <memory>
+
+class CVideoResolution
+{
+public:
+ CVideoResolution(const unsigned int resolution);
+ ~CVideoResolution() = default;
+
+ void SetSize(const int w, const int h, const int wp, const int hp);
+ std::string GetSizeString(void) const;
+
+ bool SupportedSize(const int w, const int h) const;
+ bool SupportedSizeVR360(const int w, const int h) const;
+ bool SupportedSizeByFHDDecoder(const int w, const int h) const;
+
+ int GetWidth(void) const { return w_; }
+ int GetHeight(void) const { return h_; }
+ int GetWidthPortrait(void) const { return wp_; }
+ int GetHeightPortrait(void) const { return hp_; }
+
+ static void GetResolutionSize(const unsigned int resolution, int *w, int *h);
+
+private:
+ bool LandScapeSize(const int w, const int h) const { return (w >= h) ? true:false; }
+ static bool ValidResolution(const unsigned int resolution);
+ static void GetDefaultSize(const unsigned int resolution, int *w, int *h, int *wp, int *hp);
+
+ unsigned int resolution_;
+ int w_;
+ int h_;
+ int wp_;
+ int hp_;
+};
+
+#endif //__CVIDEO_RESOLUTION_H__
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#ifndef _RI_DEBUG_H_\r
-#define _RI_DEBUG_H_\r
-\r
-#include <dlog.h>\r
-\r
-#ifdef LOG_TAG\r
-#undef LOG_TAG\r
-#endif //LOG_TAG\r
-\r
-#define ARRAY_SIZE(name) (sizeof(name)/sizeof(name[0]))\r
-\r
-#define LOG_TAG "RSC_INFO"\r
-\r
-#ifndef RI_ERR\r
-#define RI_ERR(fmt, args...) SLOGE(fmt, ##args)\r
-#endif\r
-\r
-#ifndef RI_DBG\r
-#define RI_DBG(fmt, args...) SLOGD(fmt, ##args)\r
-#endif\r
-\r
-#ifndef RI_INFO\r
-#define RI_INFO(fmt, args...) SLOGI(fmt, ##args)\r
-#endif\r
-\r
-#define RI_ARRAY_SIZE(name) (sizeof(name)/sizeof(name[0]))\r
-\r
-#endif //_RI_DEBUG_H_\r
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#ifndef _RI_DEBUG_H_
+#define _RI_DEBUG_H_
+
+#include <dlog.h>
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif //LOG_TAG
+
+#define ARRAY_SIZE(name) (sizeof(name)/sizeof(name[0]))
+
+#define LOG_TAG "RSC_INFO"
+
+#ifndef RI_ERR
+#define RI_ERR(fmt, args...) SLOGE(fmt, ##args)
+#endif
+
+#ifndef RI_DBG
+#define RI_DBG(fmt, args...) SLOGD(fmt, ##args)
+#endif
+
+#ifndef RI_INFO
+#define RI_INFO(fmt, args...) SLOGI(fmt, ##args)
+#endif
+
+#define RI_ARRAY_SIZE(name) (sizeof(name)/sizeof(name[0]))
+
+#endif //_RI_DEBUG_H_
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#ifndef __RI_JPEG_DECODER_CATEGORY__\r
-#define __RI_JPEG_DECODER_CATEGORY__\r
-\r
-/* The number of codec supported by jpeg decoder */\r
-#define NUM_OF_JPEG_CODEC 2\r
-\r
-/* The number of resolution to cover jpeg decoder dependencies */\r
-/* FHD, UHD */\r
-#define NUM_OF_JPEG_RESOLUTION 8\r
-\r
-/* Do not change order of enum because these enums are used in array ri_jpeg_decoder_categories in order */\r
-typedef enum {\r
- RI_JPEG_CODEC_JPEG = 0, // JPEG\r
- RI_JPEG_CODEC_MJPEG // MJPEG\r
-} ri_jpeg_codec;\r
-\r
-static ri_rsc_category_e RI_JPEG_DECODER_CATEGORY[NUM_OF_JPEG_CODEC][NUM_OF_JPEG_RESOLUTION]=\r
-{\r
- //JPEG\r
- { RI_CATEGORY_JPEG_DECODER_FHD, RI_CATEGORY_JPEG_DECODER_FHD, RI_CATEGORY_JPEG_DECODER_FHD, RI_CATEGORY_JPEG_DECODER_UHD, RI_CATEGORY_JPEG_DECODER_UHD, RI_CATEGORY_JPEG_DECODER_UHD, RI_CATEGORY_JPEG_DECODER_8K, RI_CATEGORY_JPEG_DECODER_8K},\r
- //MJPEG\r
- { RI_CATEGORY_MJPEG_DECODER_FHD, RI_CATEGORY_MJPEG_DECODER_FHD, RI_CATEGORY_MJPEG_DECODER_FHD, RI_CATEGORY_MJPEG_DECODER_UHD, RI_CATEGORY_JPEG_DECODER_UHD, RI_CATEGORY_MJPEG_DECODER_UHD, RI_CATEGORY_JPEG_DECODER_8K, RI_CATEGORY_MJPEG_DECODER_8K}\r
-};\r
-\r
-#endif// __RI_JPEG_DECODER_CATEGORY__\r
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#ifndef __RI_JPEG_DECODER_CATEGORY__
+#define __RI_JPEG_DECODER_CATEGORY__
+
+/* The number of codec supported by jpeg decoder */
+#define NUM_OF_JPEG_CODEC 2
+
+/* The number of resolution to cover jpeg decoder dependencies */
+/* FHD, UHD */
+#define NUM_OF_JPEG_RESOLUTION 8
+
+/* Do not change order of enum because these enums are used in array ri_jpeg_decoder_categories in order */
+typedef enum {
+ RI_JPEG_CODEC_JPEG = 0, // JPEG
+ RI_JPEG_CODEC_MJPEG // MJPEG
+} ri_jpeg_codec;
+
+static ri_rsc_category_e RI_JPEG_DECODER_CATEGORY[NUM_OF_JPEG_CODEC][NUM_OF_JPEG_RESOLUTION]=
+{
+ //JPEG
+ { RI_CATEGORY_JPEG_DECODER_FHD, RI_CATEGORY_JPEG_DECODER_FHD, RI_CATEGORY_JPEG_DECODER_FHD, RI_CATEGORY_JPEG_DECODER_UHD, RI_CATEGORY_JPEG_DECODER_UHD, RI_CATEGORY_JPEG_DECODER_UHD, RI_CATEGORY_JPEG_DECODER_8K, RI_CATEGORY_JPEG_DECODER_8K},
+ //MJPEG
+ { RI_CATEGORY_MJPEG_DECODER_FHD, RI_CATEGORY_MJPEG_DECODER_FHD, RI_CATEGORY_MJPEG_DECODER_FHD, RI_CATEGORY_MJPEG_DECODER_UHD, RI_CATEGORY_JPEG_DECODER_UHD, RI_CATEGORY_MJPEG_DECODER_UHD, RI_CATEGORY_JPEG_DECODER_8K, RI_CATEGORY_MJPEG_DECODER_8K}
+};
+
+#endif// __RI_JPEG_DECODER_CATEGORY__
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#ifndef _RI_MACRO_H_\r
-#define _RI_MACRO_H_\r
-\r
-#include <ri-debug.h>\r
-\r
-#define RI_FREE(a) \\r
- if (a) \\r
- { \\r
- free(a); \\r
- a = NULL; \\r
- }\r
-\r
-#define RI_RETURN_MINUS_IF_NULL(a, msg) \\r
- if (!a) \\r
- { \\r
- RI_ERR("%s", msg); \\r
- return -1; \\r
- }\r
-\r
-#define RI_RETURN_IF_NULL(a, msg) \\r
- if (!a) \\r
- { \\r
- RI_ERR("%s", msg); \\r
- return; \\r
- }\r
-\r
-#define RI_RETURN_NULL_IF_NULL(a, msg) \\r
- if (!a) \\r
- { \\r
- RI_ERR("%s", msg); \\r
- return NULL; \\r
- }\r
-\r
-#endif //_RI_MACRO_H_\r
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#ifndef _RI_MACRO_H_
+#define _RI_MACRO_H_
+
+#include <ri-debug.h>
+
+#define RI_FREE(a) \
+ if (a) \
+ { \
+ free(a); \
+ a = NULL; \
+ }
+
+#define RI_RETURN_MINUS_IF_NULL(a, msg) \
+ if (!a) \
+ { \
+ RI_ERR("%s", msg); \
+ return -1; \
+ }
+
+#define RI_RETURN_IF_NULL(a, msg) \
+ if (!a) \
+ { \
+ RI_ERR("%s", msg); \
+ return; \
+ }
+
+#define RI_RETURN_NULL_IF_NULL(a, msg) \
+ if (!a) \
+ { \
+ RI_ERR("%s", msg); \
+ return NULL; \
+ }
+
+#endif //_RI_MACRO_H_
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#ifndef __RI_TYPE_H__\r
-#define __RI_TYPE_H__\r
-\r
-#include <glib.h>\r
-#include <ri-module-api.h>\r
-\r
-/**\r
-* @brief The structure corresponding to resource category element defined in resource_information.xml\r
-* This structure contains contents of category element\r
-*/\r
-typedef struct {\r
- int id; /**< category id */\r
- int class_id; /**< class id */\r
- const char *name; /**< category name */\r
- bool is_uhd_device; /**< 0: not UHD device, 1: UHD device */\r
- int num_of_dev; /**< The number of devices which belong to this category */\r
- const char *codec; /**< The codec name this category supports */\r
-} ri_resource_category_s;\r
-\r
-/**\r
-* @brief The structure for device specific information\r
-*/\r
-typedef struct {\r
- unsigned int id; /**< device id */\r
- unsigned int category; /**< resource category id to which device belongs */\r
- const char *name; /**< device name */\r
- const char *path; /**< device node path */\r
- const char *omx_comp_name; /**< OMX component name corresponding to device */\r
- bool main_device; /**< true : main device, false : sub device */\r
- bool support_overlay; /**< true : support overlay bg, false : not support */\r
- int max_rez; /**< max resolution */\r
- int max_sampling_format; /**< max sampling format */\r
-} ri_device_unique_attr_s;\r
-\r
-/**\r
-* @brief The structure for memory cluster\r
-*/\r
-typedef struct {\r
- unsigned int count;\r
- unsigned int ids[RI_MEM_CLUSTER_NUM];\r
-} ri_mem_cluster_s;\r
-\r
-/**\r
-* @brief The class of resource category\r
-*/\r
-typedef enum {\r
- RI_VIDEO_CATEGORY_CLASS_LOW = 0, /**< Low class */\r
- RI_VIDEO_CATEGORY_CLASS_HIGH, /**< High class */\r
-} ri_video_decoder_class_e;\r
-\r
-/**\r
-* @brief The internal audio mixing option\r
-*/\r
-typedef enum {\r
- RI_MIXING_OPT_DEFAULT = 0, /**< default mixing option */\r
- RI_MIXING_OPT_MULTIVIEW = RI_MIXING_OPT_DEFAULT, /**< mixing option for multiview feature */\r
- RI_MIXING_OPT_INTERACTION_SOUND = (0x1 << 24) /**< mixing option for interaction sound feature */\r
-} ri_mixing_opt;\r
-\r
-\r
-#define RI_CATEGORY_VIDEO_DECODER_MIN RI_CATEGORY_VIDEO_DECODER_UHD\r
-#define RI_CATEGORY_VIDEO_DECODER_MAX RI_CATEGORY_VIDEO_DECODER_VP9_UHD_10BIT_60P\r
-\r
-#define RI_CATEGORY_AUDIO_DECODER_MIN RI_CATEGORY_AUDIO_DECODER_NOT_SUPPORTED\r
-#define RI_CATEGORY_AUDIO_DECODER_MAX RI_CATEGORY_AUDIO_DECODER_IAMF_OPUS\r
-\r
-struct ri_resource_list {\r
- int n_rsc;\r
- GList *rsc_list;\r
- GList *iter;\r
-};\r
-\r
-struct ri_video_decoder {\r
- int id;\r
- int n_codecs;\r
- GList *codec_list;\r
- GList *iter;\r
-};\r
-\r
-struct ri_vcodec {\r
- char* codec_name;\r
- int rsz_id;\r
- int framerate;\r
-};\r
-\r
-struct ri_video_property {\r
- char* codec_name;\r
- int width;\r
- int height;\r
- int fps;\r
- int color_depth;\r
- int sampling_format;\r
- bool progressive;\r
- bool detiled;\r
-};\r
-\r
-struct ri_video_encoder_property {\r
- int width;\r
- int height;\r
- int fps;\r
- bool multi;\r
-};\r
-\r
-#endif //__RI_TYPE_H__\r
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#ifndef __RI_TYPE_H__
+#define __RI_TYPE_H__
+
+#include <glib.h>
+#include <ri-module-api.h>
+
+/**
+* @brief The structure corresponding to resource category element defined in resource_information.xml
+* This structure contains contents of category element
+*/
+typedef struct {
+ int id; /**< category id */
+ int class_id; /**< class id */
+ const char *name; /**< category name */
+ bool is_uhd_device; /**< 0: not UHD device, 1: UHD device */
+ int num_of_dev; /**< The number of devices which belong to this category */
+ const char *codec; /**< The codec name this category supports */
+} ri_resource_category_s;
+
+/**
+* @brief The structure for device specific information
+*/
+typedef struct {
+ unsigned int id; /**< device id */
+ unsigned int category; /**< resource category id to which device belongs */
+ const char *name; /**< device name */
+ const char *path; /**< device node path */
+ const char *omx_comp_name; /**< OMX component name corresponding to device */
+ bool main_device; /**< true : main device, false : sub device */
+ bool support_overlay; /**< true : support overlay bg, false : not support */
+ int max_rez; /**< max resolution */
+ int max_sampling_format; /**< max sampling format */
+} ri_device_unique_attr_s;
+
+/**
+* @brief The structure for memory cluster
+*/
+typedef struct {
+ unsigned int count;
+ unsigned int ids[RI_MEM_CLUSTER_NUM];
+} ri_mem_cluster_s;
+
+/**
+* @brief The class of resource category
+*/
+typedef enum {
+ RI_VIDEO_CATEGORY_CLASS_LOW = 0, /**< Low class */
+ RI_VIDEO_CATEGORY_CLASS_HIGH, /**< High class */
+} ri_video_decoder_class_e;
+
+/**
+* @brief The internal audio mixing option
+*/
+typedef enum {
+ RI_MIXING_OPT_DEFAULT = 0, /**< default mixing option */
+ RI_MIXING_OPT_MULTIVIEW = RI_MIXING_OPT_DEFAULT, /**< mixing option for multiview feature */
+ RI_MIXING_OPT_INTERACTION_SOUND = (0x1 << 24) /**< mixing option for interaction sound feature */
+} ri_mixing_opt;
+
+
+#define RI_CATEGORY_VIDEO_DECODER_MIN RI_CATEGORY_VIDEO_DECODER_UHD
+#define RI_CATEGORY_VIDEO_DECODER_MAX RI_CATEGORY_VIDEO_DECODER_VP9_UHD_10BIT_60P
+
+#define RI_CATEGORY_AUDIO_DECODER_MIN RI_CATEGORY_AUDIO_DECODER_NOT_SUPPORTED
+#define RI_CATEGORY_AUDIO_DECODER_MAX RI_CATEGORY_AUDIO_DECODER_IAMF_OPUS
+
+struct ri_resource_list {
+ int n_rsc;
+ GList *rsc_list;
+ GList *iter;
+};
+
+struct ri_video_decoder {
+ int id;
+ int n_codecs;
+ GList *codec_list;
+ GList *iter;
+};
+
+struct ri_vcodec {
+ char* codec_name;
+ int rsz_id;
+ int framerate;
+};
+
+struct ri_video_property {
+ char* codec_name;
+ int width;
+ int height;
+ int fps;
+ int color_depth;
+ int sampling_format;
+ bool progressive;
+ bool detiled;
+};
+
+struct ri_video_encoder_property {
+ int width;
+ int height;
+ int fps;
+ bool multi;
+};
+
+#endif //__RI_TYPE_H__
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#ifndef __RI_VIDEO_DECODER_CATEGORY_TYPE_H__\r
-#define __RI_VIDEO_DECODER_CATEGORY_TYPE_H__\r
-\r
-#include <ri-common-type.h>\r
-\r
-#ifdef __cplusplus\r
-extern "C"{\r
-#endif\r
-\r
-/* The number of video codec supported by video decoder */\r
-#define NUM_OF_VIDEO_CODEC 19\r
-\r
-/* The number of color depth to cover video decoder dependencies */\r
-/* 8bit, 10bit, 10bit 4:2:0, 10bit 4:2:2 */\r
-#define NUM_OF_COLOR_DEPTH 4\r
-\r
-/* The number of resolution to cover video decoder dependencies */\r
-/* FHD, UHD, 8K */\r
-#define NUM_OF_RESOLUTION 3\r
-\r
-/* The number of frame rate to cover video decoder dependencies */\r
-/* 30P, 60P, 120P */\r
-#define NUM_OF_FRAMERATE 3\r
-\r
-/* width of qHD */\r
-#define qHD_W 960\r
-/* height of qHD */\r
-#define qHD_H 540\r
-/* width of HD */\r
-#define HD_W 1280\r
-/* height of HD */\r
-#define HD_H 720\r
-/* Max width of FHD */\r
-#define FHD_W 1920\r
-/* Max height of FHD */\r
-#define FHD_H 1088\r
-/* Max height of FHD in vertical mode */\r
-#define FHD_H_V 1080\r
-/* Max width of 4K UHD */\r
-#define UHD_4K_W 4096\r
-/* Max height of 4K UHD */\r
-#define UHD_4K_H 2160\r
-/* Max width of 5K */\r
-#define UHD_5K_W 5120\r
-/* Max height of 5K */\r
-#define UHD_5K_H 2880\r
-/* Max width of 8K UHD */\r
-#define UHD_8K_W 7680\r
-/* Max height of 8K UHD */\r
-#define UHD_8K_H 4320\r
-\r
-typedef enum {\r
- RI_COLOR_DEPTH_8BIT = 0,\r
- RI_COLOR_DEPTH_10BIT,\r
- RI_COLOR_DEPTH_10BIT_420,\r
- RI_COLOR_DEPTH_10BIT_422\r
-} ri_color_depth;\r
-\r
-typedef enum {\r
- RI_RESOLUTION_UNDEFINED = -1,\r
- RI_RESOLUTION_qHD = 0,\r
- RI_RESOLUTION_HD,\r
- RI_RESOLUTION_FHD, /**< 1920 x 1080 */\r
- RI_RESOLUTION_QuadHD, /**< 2560 x 1440 */\r
- RI_RESOLUTION_DQHD, /**< 5120 x 1440 (32:9) */\r
- RI_RESOLUTION_4K_UHD, /**< 4096 x 2160 */\r
- RI_RESOLUTION_5K, /**< 5120 x 2880 (16:9) */\r
- RI_RESOLUTION_8K_UHD /**< 7280 x 4560 */\r
-} ri_resolution;\r
-\r
-typedef enum {\r
- RI_FRAMERATE_UNDEFINED = -1,\r
- RI_FRAMERATE_30 = 0,\r
- RI_FRAMERATE_60,\r
- RI_FRAMERATE_120\r
-} ri_framerate;\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-#endif //__RI_VIDEO_DECODER_CATEGORY_TYPE_H__\r
-\r
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#ifndef __RI_VIDEO_DECODER_CATEGORY_TYPE_H__
+#define __RI_VIDEO_DECODER_CATEGORY_TYPE_H__
+
+#include <ri-common-type.h>
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+/* The number of video codec supported by video decoder */
+#define NUM_OF_VIDEO_CODEC 19
+
+/* The number of color depth to cover video decoder dependencies */
+/* 8bit, 10bit, 10bit 4:2:0, 10bit 4:2:2 */
+#define NUM_OF_COLOR_DEPTH 4
+
+/* The number of resolution to cover video decoder dependencies */
+/* FHD, UHD, 8K */
+#define NUM_OF_RESOLUTION 3
+
+/* The number of frame rate to cover video decoder dependencies */
+/* 30P, 60P, 120P */
+#define NUM_OF_FRAMERATE 3
+
+/* width of qHD */
+#define qHD_W 960
+/* height of qHD */
+#define qHD_H 540
+/* width of HD */
+#define HD_W 1280
+/* height of HD */
+#define HD_H 720
+/* Max width of FHD */
+#define FHD_W 1920
+/* Max height of FHD */
+#define FHD_H 1088
+/* Max height of FHD in vertical mode */
+#define FHD_H_V 1080
+/* Max width of 4K UHD */
+#define UHD_4K_W 4096
+/* Max height of 4K UHD */
+#define UHD_4K_H 2160
+/* Max width of 5K */
+#define UHD_5K_W 5120
+/* Max height of 5K */
+#define UHD_5K_H 2880
+/* Max width of 8K UHD */
+#define UHD_8K_W 7680
+/* Max height of 8K UHD */
+#define UHD_8K_H 4320
+
+typedef enum {
+ RI_COLOR_DEPTH_8BIT = 0,
+ RI_COLOR_DEPTH_10BIT,
+ RI_COLOR_DEPTH_10BIT_420,
+ RI_COLOR_DEPTH_10BIT_422
+} ri_color_depth;
+
+typedef enum {
+ RI_RESOLUTION_UNDEFINED = -1,
+ RI_RESOLUTION_qHD = 0,
+ RI_RESOLUTION_HD,
+ RI_RESOLUTION_FHD, /**< 1920 x 1080 */
+ RI_RESOLUTION_QuadHD, /**< 2560 x 1440 */
+ RI_RESOLUTION_DQHD, /**< 5120 x 1440 (32:9) */
+ RI_RESOLUTION_4K_UHD, /**< 4096 x 2160 */
+ RI_RESOLUTION_5K, /**< 5120 x 2880 (16:9) */
+ RI_RESOLUTION_8K_UHD /**< 7280 x 4560 */
+} ri_resolution;
+
+typedef enum {
+ RI_FRAMERATE_UNDEFINED = -1,
+ RI_FRAMERATE_30 = 0,
+ RI_FRAMERATE_60,
+ RI_FRAMERATE_120
+} ri_framerate;
+
+#ifdef __cplusplus
+}
+#endif
+#endif //__RI_VIDEO_DECODER_CATEGORY_TYPE_H__
+
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#include <assert.h>\r
-#include <CImageCodec.h>\r
-\r
-CImageCodec::CImageCodec(std::string name)\r
-{\r
- m_name = name;\r
-}\r
-\r
-// LCOV_EXCL_START\r
-CImageCodec::~CImageCodec()\r
-{\r
-}\r
-// LCOV_EXCL_END\r
-\r
-void CImageCodec::GetMaxResolution(int *w, int *h)\r
-{\r
- *w = m_width_max;\r
- *h = m_height_max;\r
-}\r
-\r
-void CImageCodec::GetMinResolution(int *w, int *h)\r
-{\r
- *w = m_width_min;\r
- *h = m_height_min;\r
-}\r
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include <assert.h>
+#include <CImageCodec.h>
+
+CImageCodec::CImageCodec(std::string name)
+{
+ m_name = name;
+}
+
+// LCOV_EXCL_START
+CImageCodec::~CImageCodec()
+{
+}
+// LCOV_EXCL_END
+
+void CImageCodec::GetMaxResolution(int *w, int *h)
+{
+ *w = m_width_max;
+ *h = m_height_max;
+}
+
+void CImageCodec::GetMinResolution(int *w, int *h)
+{
+ *w = m_width_min;
+ *h = m_height_min;
+}
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#include <stdio.h>\r
-#include <unistd.h>\r
-#include <string.h>\r
-#include <string>\r
-#include <fcntl.h>\r
-#include <system_info.h>\r
-\r
-\r
-#include <ri-common-type.h>\r
-#include <ri-debug.h>\r
-#include <ri-jpeg-decoder-category.h>\r
-\r
-#include <CModelInfo.h>\r
-#include <CVideoCodec.h>\r
-#include <CResourceInfoDB.h>\r
-#include <CResourceInfo.h>\r
-\r
-#define IS_FHD_RESOLUTION_HORIZONTAL(w, h) (w <= FHD_W && h <= FHD_H)\r
-#define IS_FHD_RESOLUTION_VERTICAL(w, h) (w <= FHD_H_V && h <= FHD_W)\r
-#define IS_4K_RESOLUTION_HORIZONTAL(w, h) ((w > FHD_W || h > FHD_H) && (w <= UHD_4K_W && h <= UHD_4K_H))\r
-#define IS_4K_RESOLUTION_VERTICAL(w, h) ((w > FHD_H_V || h > FHD_W) && (w <= UHD_4K_H && h <= UHD_4K_W))\r
-\r
-#define IS_FRAMERATE_30P(f) ((f > 0) && (f <= 30))\r
-#define IS_FRAMERATE_60P(f) ((f > 30) && (f <= 60))\r
-#define IS_FRAMERATE_120P(f) ((f > 60) && (f <= 120))\r
-\r
-CResourceInfo* CResourceInfo::m_instance = NULL;\r
-\r
-CResourceInfo::CResourceInfo(void)\r
-{\r
-}\r
-\r
-CResourceInfo::~CResourceInfo(void){}\r
-\r
-CResourceInfo* CResourceInfo::GetInstance(void)\r
-{\r
- if (m_instance == NULL) {\r
- m_instance = new CResourceInfo;\r
- }\r
-\r
- return m_instance;\r
-}\r
-\r
-ri_rsc_category_e CResourceInfo::GetVideoCategoryID(const char *codec_name, int color_depth, int h_size, int framerate, int sampling_format)\r
-{\r
- ri_video_category_option_request_s option;\r
-\r
- option.codec_name = codec_name;\r
- option.color_depth = color_depth;\r
- option.h_size = h_size;\r
- option.v_size = 1;\r
- option.framerate = framerate;\r
- option.sampling_format = sampling_format;\r
-\r
- return GetCapableVideoCategoryID(&option, false);\r
-}\r
-\r
-bool CResourceInfo::NeedDedicatedCategoryH264Portrait(std::string codec_name, int w, int h)\r
-{\r
- if (codec_name.compare(RI_CODEC_NAME_H264))\r
- return false;\r
-\r
- CVideoCodec* codec = CResourceInfoDB::GetInstance()->FindVideoCodec(RI_CODEC_NAME_H264);\r
- if (!codec)\r
- return false;\r
-\r
- return codec->IsSizeNotSupportedByFHDDecoder(RI_RESOLUTION_FHD, w, h);\r
-}\r
-\r
-ri_rsc_category_e CResourceInfo::GetCapableVideoCategoryID(std::string codec_name, int width, int height, int framerate, int sampling_format, int color_depth, bool n_decoding)\r
-{\r
- RI_INFO("codec(%s)/color_depth(%d)/h(%d)/v(%d)/frame(%d)/sampling(%d)", codec_name.c_str(), color_depth, width, height, framerate, sampling_format);\r
-\r
- int rsz_id = GetResolutionID(width, height, n_decoding, codec_name);\r
- if (rsz_id == RI_RESOLUTION_UNDEFINED) {\r
- RI_ERR("failed to get resolution id codec(%s)/h(%d)/v(%d)\n", codec_name.c_str(), width, height);\r
- return RI_CATEGORY_VIDEO_DECODER_NOT_SUPPORTED;\r
- }\r
-\r
- int color_depth_id = GetColorDepthID(color_depth, sampling_format);\r
- if (color_depth_id == (ri_color_depth) RI_ERROR) {\r
- RI_ERR("failed to get color depth id(%d)\n", color_depth_id);\r
- return RI_CATEGORY_VIDEO_DECODER_NOT_SUPPORTED;\r
- }\r
-\r
- int framerate_id = GetFrameRateID(framerate);\r
- if (framerate_id == RI_FRAMERATE_UNDEFINED) {\r
- RI_ERR("failed to get framerate(%d)\n",framerate_id);\r
- return RI_CATEGORY_VIDEO_DECODER_NOT_SUPPORTED;\r
- }\r
-\r
- //support 1280*720 60p dual decoding, so convert it to 30\r
- if ((!codec_name.compare(RI_CODEC_NAME_H264_MVC)) && (framerate_id == RI_FRAMERATE_60) && (width <= 1280))\r
- framerate_id = RI_FRAMERATE_30;\r
-\r
- CResourceInfoDB *db = CResourceInfoDB::GetInstance();\r
- int category_id = db->GetVideoDecCategoryId(codec_name, rsz_id, framerate_id, color_depth_id);\r
-\r
-// LCOV_EXCL_START\r
- if (n_decoding)\r
- category_id = db->ToNDecodingCategory(category_id);\r
-\r
- if (NeedDedicatedCategoryH264Portrait(codec_name, width, height))\r
- category_id = ToPortraitCategory(category_id);\r
-// LCOV_EXCL_END\r
- RI_INFO("n_decoding(%d), category id : %d", n_decoding, category_id);\r
-\r
- return (n_decoding) ? db->IsNDecodingSupportedVideoFormat((ri_rsc_category_e) category_id):db->IsSupportedVideoFormat((ri_rsc_category_e) category_id);\r
-}\r
-\r
-ri_rsc_category_e CResourceInfo::GetCapableVideoCategoryID(ri_video_category_option_request_s* option, bool n_decoding)\r
-{\r
- return GetCapableVideoCategoryID(option->codec_name, option->h_size, option->v_size, option->framerate, option->sampling_format, option->color_depth, n_decoding);\r
-}\r
-\r
-ri_rsc_category_e CResourceInfo::GetCapableVideoCategoryID(ri_video_property* prop, bool n_decoding)\r
-{\r
- ri_rsc_category_e category_id = GetCapableVideoCategoryID(prop->codec_name, prop->width, prop->height, prop->fps, prop->sampling_format, prop->color_depth, n_decoding);\r
- if (prop->detiled)\r
- return ToCategoryDedicatedToDetiled(category_id);\r
- return (prop->progressive) ? ToCategoryDedicatedToProgressive(category_id):category_id;\r
-}\r
-\r
-ri_rsc_category_e CResourceInfo::ToCategoryDedicatedToProgressive(ri_rsc_category_e category_id)\r
-{\r
- ri_rsc_category_e result = category_id;\r
- switch(category_id) {\r
- case RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_30P:\r
- if (CResourceInfoDB::GetInstance()->IsSupportedVideoFormat(RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_30P_PROGRESSIVE) != RI_CATEGORY_VIDEO_DECODER_NOT_SUPPORTED)\r
- result = RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_30P_PROGRESSIVE;\r
- break;\r
- case RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_60P:\r
- if (CResourceInfoDB::GetInstance()->IsSupportedVideoFormat(RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_60P_PROGRESSIVE) != RI_CATEGORY_VIDEO_DECODER_NOT_SUPPORTED)\r
- result = RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_60P_PROGRESSIVE;\r
- break;\r
- default:\r
- break;\r
- }\r
- RI_INFO("category id (%d > %d)", category_id, result);\r
- return result;\r
-}\r
-\r
-ri_rsc_category_e CResourceInfo::ToCategoryDedicatedToDetiled(ri_rsc_category_e category_id)\r
-{\r
- ri_rsc_category_e result = category_id;\r
- switch(category_id) {\r
- case RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_30P:\r
- result = RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_30P_DETILED;\r
- break;\r
- case RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_60P:\r
- result = RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_60P_DETILED;\r
- break;\r
- default:\r
- break;\r
- }\r
- RI_INFO("category id (%d > %d)", category_id, result);\r
- return result;\r
-}\r
-\r
-ri_rsc_category_e CResourceInfo::GetCapableMJpegDecoderCategoryID(const char *codec_name, int h_size)\r
-{\r
- int jpeg_codec_id = RI_JPEG_CODEC_MJPEG;\r
-\r
- if (!codec_name) {\r
- RI_ERR("invalid param");\r
- return RI_CATEGORY_MJPEG_DECODER_NOT_SUPPORTED;\r
- }\r
-\r
- std::string codec(codec_name);\r
-\r
- RI_INFO("codec(%s)/h(%d)", codec_name, h_size);\r
-\r
- if (codec.compare(RI_CODEC_NAME_MJPEG)) {\r
- RI_ERR("unknown jpeg codec (%s)", codec.c_str());\r
- return RI_CATEGORY_MJPEG_DECODER_NOT_SUPPORTED;\r
- }\r
-\r
- ri_resolution resolution_id = GetResolutionID(h_size);\r
-\r
- if (resolution_id == RI_RESOLUTION_UNDEFINED) {\r
- RI_ERR("failed to get resolution id (%d)", h_size);\r
- return RI_CATEGORY_MJPEG_DECODER_NOT_SUPPORTED;\r
- }\r
-\r
- ri_rsc_category_e category_id = RI_JPEG_DECODER_CATEGORY[jpeg_codec_id][resolution_id];\r
-\r
- return CResourceInfoDB::GetInstance()->IsSupportedMJpegFormat(category_id);\r
-}\r
-\r
-ri_resolution CResourceInfo::GetResolutionID(int resolution)\r
-{\r
- ri_resolution result = RI_RESOLUTION_UNDEFINED;\r
-\r
- if (resolution < FHD_W && resolution > 0) {\r
- result = RI_RESOLUTION_FHD;\r
- } else if (resolution > FHD_W && resolution <= UHD_4K_W) {\r
- result = RI_RESOLUTION_4K_UHD;\r
- } else {\r
- result = RI_RESOLUTION_8K_UHD;\r
- }\r
-\r
- return result;\r
-}\r
-\r
-ri_resolution CResourceInfo::GetResolutionID(const std::string codec_name, const int w, const int h)\r
-{\r
- std::string name = (!codec_name.compare(RI_CODEC_NAME_H264_MVC)) ? RI_CODEC_NAME_H264 : codec_name;\r
-\r
- CVideoCodec *codec = CResourceInfoDB::GetInstance()->FindVideoCodec(name);\r
- if (!codec)\r
- return RI_RESOLUTION_UNDEFINED;\r
-\r
- return codec->GetResolutionID(w, h);\r
-}\r
-\r
-ri_resolution CResourceInfo::GetResolutionID(int w, int h, bool n_decoding, std::string codec_name)\r
-{\r
- ri_resolution result = RI_RESOLUTION_UNDEFINED;\r
-\r
- if (w <= 0 || h <= 0) {\r
- RI_ERR("not supported (%d * %d)", w, h);\r
- return RI_RESOLUTION_UNDEFINED;\r
- }\r
-\r
- result = GetResolutionID(codec_name, w, h);\r
-\r
- if (!n_decoding) {\r
- if (result == RI_RESOLUTION_HD || result == RI_RESOLUTION_qHD)\r
- result = RI_RESOLUTION_FHD;\r
- }\r
-\r
- RI_INFO("video resolution(%d) by w(%d) & h(%d)", result, w, h);\r
- return result;\r
-}\r
-\r
-// LCOV_EXCL_START\r
-int CResourceInfo::ToPortraitCategory(int category)\r
-{\r
- int result = category;\r
- switch(category) {\r
- case RI_CATEGORY_VIDEO_DECODER_H264_UHD_8BIT_30P:\r
- result = RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_30P_PORTRAIT;\r
- break;\r
- case RI_CATEGORY_VIDEO_DECODER_H264_UHD_8BIT_60P:\r
- result = RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_60P_PORTRAIT;\r
- break;\r
- default:\r
- break;\r
- }\r
-\r
- RI_INFO("(%d > %d)", category, result);\r
- return result;\r
-}\r
-// LCOV_EXCL_END\r
-\r
-bool CResourceInfo::IsValidImageResolution(std::string codec, int w, int h)\r
-{\r
- if (w <= 0 || h <= 0) {\r
- RI_ERR("not supported (%d * %d)", w, h);\r
- return false;\r
- }\r
-\r
- int max_w = 0;\r
- int max_h = 0;\r
- int min_w = 0;\r
- int min_h = 0;\r
-\r
- CResourceInfoDB::GetInstance()->GetImageMinMaxResolution(codec, &min_w, &min_h, &max_w, &max_h);\r
- if (w > max_w || h > max_h) {\r
- RI_ERR("[%s] not supported (%d * %d), max(%d * %d)", codec.c_str(), w, h, max_w, max_h);\r
- return false;\r
- }\r
-\r
- if (w < min_w || h < min_h) {\r
- RI_ERR("[%s] not supported (%d * %d), min(%d * %d)", codec.c_str(), w, h, min_w, min_h);\r
- return false;\r
- }\r
-\r
- return true;\r
-}\r
-\r
-ri_resolution CResourceInfo::GetImageResolutionID(std::string codec, int w, int h)\r
-{\r
- if (!IsValidImageResolution(codec, w, h))\r
- return RI_RESOLUTION_UNDEFINED;\r
-\r
- ri_resolution result = RI_RESOLUTION_FHD;\r
-\r
- if (!IS_FHD_RESOLUTION_HORIZONTAL(w, h)) {\r
- result = IS_4K_RESOLUTION_HORIZONTAL(w, h) ? RI_RESOLUTION_4K_UHD:RI_RESOLUTION_8K_UHD;\r
- }\r
-\r
- return result;\r
-}\r
-\r
-ri_rsc_category_e CResourceInfo::GetSubJpegCategoryID(const char *codec_name,int w_size,int h_size)\r
-{\r
- int jpeg_codec_id = RI_JPEG_CODEC_JPEG;\r
-\r
- if (!codec_name) {\r
- RI_ERR("invalid param");\r
- return RI_CATEGORY_JPEG_DECODER_NOT_SUPPORTED;\r
- }\r
-\r
- RI_INFO("codec(%s)/w(%d)/h(%d)", codec_name, w_size, h_size);\r
-\r
- std::string codec(codec_name);\r
-\r
- if (codec.compare(RI_CODEC_NAME_JPEG)) {\r
- RI_ERR("unknown jpeg codec (%s)", codec.c_str());\r
- return RI_CATEGORY_JPEG_DECODER_NOT_SUPPORTED;\r
- }\r
-\r
- ri_resolution resolution_id = GetImageResolutionID(codec, w_size, h_size);\r
-\r
- if (resolution_id == RI_RESOLUTION_UNDEFINED)\r
- return RI_CATEGORY_JPEG_DECODER_NOT_SUPPORTED;\r
-\r
- ri_rsc_category_e category_id = RI_JPEG_DECODER_CATEGORY[jpeg_codec_id][resolution_id];\r
-\r
- if (resolution_id == RI_RESOLUTION_8K_UHD) {\r
- bool dec_8k_exist = (CResourceInfoDB::GetInstance()->IsSupportedJpegFormat(category_id) == RI_CATEGORY_JPEG_DECODER_NOT_SUPPORTED) ?false:true;\r
-\r
- category_id = (!dec_8k_exist) ?RI_CATEGORY_JPEG_DECODER_UHD:RI_CATEGORY_JPEG_DECODER_8K;\r
- }\r
-\r
- return CResourceInfoDB::GetInstance()->IsSupportedJpegFormat(category_id);\r
-}\r
-// LCOV_EXCL_START\r
-ri_rsc_category_e CResourceInfo::GetHEICCategoryID(const char *codec_name, int w_size, int h_size)\r
-{\r
- std::string codec(codec_name);\r
-\r
- ri_resolution resolution_id = GetImageResolutionID(codec, w_size, h_size);\r
- if (resolution_id == RI_RESOLUTION_UNDEFINED)\r
- return RI_CATEGORY_IMAGE_DECODER_NOT_SUPPORTED;\r
-\r
- return CResourceInfoDB::GetInstance()->IsSupportedImageFormat(RI_CATEGORY_HEIC_DECODER);\r
-}\r
-\r
-ri_rsc_category_e CResourceInfo::GetImageCategoryID(const char *codec_name, int w_size, int h_size)\r
-{\r
- ri_rsc_category_e result;\r
- std::string codec(codec_name);\r
-\r
- if (!codec.compare(RI_CODEC_NAME_JPEG)) {\r
- result = GetSubJpegCategoryID(codec_name, w_size, h_size);\r
- return (result == RI_CATEGORY_JPEG_DECODER_NOT_SUPPORTED) ? RI_CATEGORY_IMAGE_DECODER_NOT_SUPPORTED:result;\r
- }\r
-\r
- if (!codec.compare(RI_CODEC_NAME_HEIC))\r
- return GetHEICCategoryID(codec_name, w_size, h_size);\r
-\r
- RI_ERR("not supported (%s)", codec_name);\r
- return RI_CATEGORY_IMAGE_DECODER_NOT_SUPPORTED;\r
-}\r
-// LCOV_EXCL_END\r
-\r
-ri_color_depth CResourceInfo::GetColorDepthID(int color_depth, int sampling_format)\r
-{\r
- if (color_depth == 8) { //sampling_format, RI_SAMPLING_FORMAT_OTHERS\r
- return RI_COLOR_DEPTH_8BIT;\r
- } else if (color_depth == 10 && sampling_format == RI_SAMPLING_FORMAT_420) {\r
- return RI_COLOR_DEPTH_10BIT_420;\r
- } else if (color_depth == 10 && sampling_format == RI_SAMPLING_FORMAT_422) {\r
- return RI_COLOR_DEPTH_10BIT_422;\r
- } else if (color_depth == 10) { //sampling_format, RI_SAMPLING_FORMAT_OTHERS\r
- return RI_COLOR_DEPTH_10BIT;\r
- } else {\r
- RI_ERR("unknown color depth (%d)\n", color_depth);\r
- return (ri_color_depth)-1;\r
- }\r
-}\r
-\r
-ri_framerate CResourceInfo::GetFrameRateID(int framerate)\r
-{\r
- ri_framerate framerate_e = RI_FRAMERATE_UNDEFINED;\r
-\r
- if (IS_FRAMERATE_30P(framerate)) {\r
- framerate_e = RI_FRAMERATE_30;\r
- } else if (IS_FRAMERATE_60P(framerate)) {\r
- framerate_e = RI_FRAMERATE_60;\r
- } else if (IS_FRAMERATE_120P(framerate)) {\r
- framerate_e = RI_FRAMERATE_120;\r
- } else {\r
- RI_ERR("unexpected frame rate (%d)\n", framerate);\r
- }\r
-\r
- return framerate_e;\r
-}\r
-\r
-// LCOV_EXCL_START\r
-int CResourceInfo::GetMixingOption(ri_audio_mixing_mode mixing_mode)\r
-{\r
- int result = -1;\r
-\r
- switch(mixing_mode) {\r
- case RI_MIXING_MODE_DEFAULT:\r
- result = RI_MIXING_OPT_DEFAULT;\r
- break;\r
- case RI_MIXING_MODE_MULTIVIEW:\r
- result = RI_MIXING_OPT_MULTIVIEW;\r
- break;\r
- case RI_MIXING_MODE_INTERACTION_SOUND:\r
- result = RI_MIXING_OPT_INTERACTION_SOUND;\r
- break;\r
- default:\r
- RI_ERR("undefined mixing mode(%d)", mixing_mode);\r
- result = RI_MIXING_OPT_DEFAULT;\r
- break;\r
- }\r
-\r
- return result;\r
-}\r
-\r
-bool CResourceInfo::IsNormalMode(void)\r
-{\r
- const char *rsc_event_name = "/tmp/.rsc_policy_activated";\r
- //return (LwipcWaitEvent(rsc_event_name, 0) == 0;\r
-\r
- return access(rsc_event_name, F_OK) == 0;\r
-}\r
-\r
-int CResourceInfo::GetCapableAudioDecoderCategoryID(ri_audio_category_option_request_s* option)\r
-{\r
- if (!option || !option->codec_name) {\r
- RI_ERR("invalid parameter!");\r
- return RI_CATEGORY_AUDIO_DECODER_NOT_SUPPORTED;\r
- }\r
-\r
- int mixing_option = GetMixingOption(option->mixing_mode);\r
- if (mixing_option < 0) {\r
- RI_ERR("invalid mixing mode(%d)", option->mixing_mode);\r
- return RI_CATEGORY_AUDIO_DECODER_NOT_SUPPORTED;\r
- }\r
-\r
- int category_id = CResourceInfoDB::GetInstance()->GetAudioDecoderCategoryId(option->codec_name);\r
-\r
- RI_INFO("codec(%s)/mixing(%d)/result(%d)", option->codec_name, option->mixing_mode, category_id);\r
-\r
- if (category_id == RI_CATEGORY_AUDIO_DECODER_NOT_SUPPORTED)\r
- return category_id;\r
-\r
- if (option->mixing_mode == RI_MIXING_MODE_MULTIVIEW && IsNormalMode()) {\r
- RI_INFO("normal mode : category id (%d > %d)", category_id, RI_CATEGORY_AUDIO_DECODER);\r
- return RI_CATEGORY_AUDIO_DECODER;\r
- }\r
-\r
- return (category_id | mixing_option);\r
-}\r
-// LCOV_EXCL_STOP\r
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <string>
+#include <fcntl.h>
+#include <system_info.h>
+
+
+#include <ri-common-type.h>
+#include <ri-debug.h>
+#include <ri-jpeg-decoder-category.h>
+
+#include <CModelInfo.h>
+#include <CVideoCodec.h>
+#include <CResourceInfoDB.h>
+#include <CResourceInfo.h>
+
+#define IS_FHD_RESOLUTION_HORIZONTAL(w, h) (w <= FHD_W && h <= FHD_H)
+#define IS_FHD_RESOLUTION_VERTICAL(w, h) (w <= FHD_H_V && h <= FHD_W)
+#define IS_4K_RESOLUTION_HORIZONTAL(w, h) ((w > FHD_W || h > FHD_H) && (w <= UHD_4K_W && h <= UHD_4K_H))
+#define IS_4K_RESOLUTION_VERTICAL(w, h) ((w > FHD_H_V || h > FHD_W) && (w <= UHD_4K_H && h <= UHD_4K_W))
+
+#define IS_FRAMERATE_30P(f) ((f > 0) && (f <= 30))
+#define IS_FRAMERATE_60P(f) ((f > 30) && (f <= 60))
+#define IS_FRAMERATE_120P(f) ((f > 60) && (f <= 120))
+
+CResourceInfo* CResourceInfo::m_instance = NULL;
+
+CResourceInfo::CResourceInfo(void)
+{
+}
+
+CResourceInfo::~CResourceInfo(void){}
+
+CResourceInfo* CResourceInfo::GetInstance(void)
+{
+ if (m_instance == NULL) {
+ m_instance = new CResourceInfo;
+ }
+
+ return m_instance;
+}
+
+ri_rsc_category_e CResourceInfo::GetVideoCategoryID(const char *codec_name, int color_depth, int h_size, int framerate, int sampling_format)
+{
+ ri_video_category_option_request_s option;
+
+ option.codec_name = codec_name;
+ option.color_depth = color_depth;
+ option.h_size = h_size;
+ option.v_size = 1;
+ option.framerate = framerate;
+ option.sampling_format = sampling_format;
+
+ return GetCapableVideoCategoryID(&option, false);
+}
+
+bool CResourceInfo::NeedDedicatedCategoryH264Portrait(std::string codec_name, int w, int h)
+{
+ if (codec_name.compare(RI_CODEC_NAME_H264))
+ return false;
+
+ CVideoCodec* codec = CResourceInfoDB::GetInstance()->FindVideoCodec(RI_CODEC_NAME_H264);
+ if (!codec)
+ return false;
+
+ return codec->IsSizeNotSupportedByFHDDecoder(RI_RESOLUTION_FHD, w, h);
+}
+
+ri_rsc_category_e CResourceInfo::GetCapableVideoCategoryID(std::string codec_name, int width, int height, int framerate, int sampling_format, int color_depth, bool n_decoding)
+{
+ RI_INFO("codec(%s)/color_depth(%d)/h(%d)/v(%d)/frame(%d)/sampling(%d)", codec_name.c_str(), color_depth, width, height, framerate, sampling_format);
+
+ int rsz_id = GetResolutionID(width, height, n_decoding, codec_name);
+ if (rsz_id == RI_RESOLUTION_UNDEFINED) {
+ RI_ERR("failed to get resolution id codec(%s)/h(%d)/v(%d)\n", codec_name.c_str(), width, height);
+ return RI_CATEGORY_VIDEO_DECODER_NOT_SUPPORTED;
+ }
+
+ int color_depth_id = GetColorDepthID(color_depth, sampling_format);
+ if (color_depth_id == (ri_color_depth) RI_ERROR) {
+ RI_ERR("failed to get color depth id(%d)\n", color_depth_id);
+ return RI_CATEGORY_VIDEO_DECODER_NOT_SUPPORTED;
+ }
+
+ int framerate_id = GetFrameRateID(framerate);
+ if (framerate_id == RI_FRAMERATE_UNDEFINED) {
+ RI_ERR("failed to get framerate(%d)\n",framerate_id);
+ return RI_CATEGORY_VIDEO_DECODER_NOT_SUPPORTED;
+ }
+
+ //support 1280*720 60p dual decoding, so convert it to 30
+ if ((!codec_name.compare(RI_CODEC_NAME_H264_MVC)) && (framerate_id == RI_FRAMERATE_60) && (width <= 1280))
+ framerate_id = RI_FRAMERATE_30;
+
+ CResourceInfoDB *db = CResourceInfoDB::GetInstance();
+ int category_id = db->GetVideoDecCategoryId(codec_name, rsz_id, framerate_id, color_depth_id);
+
+// LCOV_EXCL_START
+ if (n_decoding)
+ category_id = db->ToNDecodingCategory(category_id);
+
+ if (NeedDedicatedCategoryH264Portrait(codec_name, width, height))
+ category_id = ToPortraitCategory(category_id);
+// LCOV_EXCL_END
+ RI_INFO("n_decoding(%d), category id : %d", n_decoding, category_id);
+
+ return (n_decoding) ? db->IsNDecodingSupportedVideoFormat((ri_rsc_category_e) category_id):db->IsSupportedVideoFormat((ri_rsc_category_e) category_id);
+}
+
+ri_rsc_category_e CResourceInfo::GetCapableVideoCategoryID(ri_video_category_option_request_s* option, bool n_decoding)
+{
+ return GetCapableVideoCategoryID(option->codec_name, option->h_size, option->v_size, option->framerate, option->sampling_format, option->color_depth, n_decoding);
+}
+
+ri_rsc_category_e CResourceInfo::GetCapableVideoCategoryID(ri_video_property* prop, bool n_decoding)
+{
+ ri_rsc_category_e category_id = GetCapableVideoCategoryID(prop->codec_name, prop->width, prop->height, prop->fps, prop->sampling_format, prop->color_depth, n_decoding);
+ if (prop->detiled)
+ return ToCategoryDedicatedToDetiled(category_id);
+ return (prop->progressive) ? ToCategoryDedicatedToProgressive(category_id):category_id;
+}
+
+ri_rsc_category_e CResourceInfo::ToCategoryDedicatedToProgressive(ri_rsc_category_e category_id)
+{
+ ri_rsc_category_e result = category_id;
+ switch(category_id) {
+ case RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_30P:
+ if (CResourceInfoDB::GetInstance()->IsSupportedVideoFormat(RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_30P_PROGRESSIVE) != RI_CATEGORY_VIDEO_DECODER_NOT_SUPPORTED)
+ result = RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_30P_PROGRESSIVE;
+ break;
+ case RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_60P:
+ if (CResourceInfoDB::GetInstance()->IsSupportedVideoFormat(RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_60P_PROGRESSIVE) != RI_CATEGORY_VIDEO_DECODER_NOT_SUPPORTED)
+ result = RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_60P_PROGRESSIVE;
+ break;
+ default:
+ break;
+ }
+ RI_INFO("category id (%d > %d)", category_id, result);
+ return result;
+}
+
+ri_rsc_category_e CResourceInfo::ToCategoryDedicatedToDetiled(ri_rsc_category_e category_id)
+{
+ ri_rsc_category_e result = category_id;
+ switch(category_id) {
+ case RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_30P:
+ result = RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_30P_DETILED;
+ break;
+ case RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_60P:
+ result = RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_60P_DETILED;
+ break;
+ default:
+ break;
+ }
+ RI_INFO("category id (%d > %d)", category_id, result);
+ return result;
+}
+
+ri_rsc_category_e CResourceInfo::GetCapableMJpegDecoderCategoryID(const char *codec_name, int h_size)
+{
+ int jpeg_codec_id = RI_JPEG_CODEC_MJPEG;
+
+ if (!codec_name) {
+ RI_ERR("invalid param");
+ return RI_CATEGORY_MJPEG_DECODER_NOT_SUPPORTED;
+ }
+
+ std::string codec(codec_name);
+
+ RI_INFO("codec(%s)/h(%d)", codec_name, h_size);
+
+ if (codec.compare(RI_CODEC_NAME_MJPEG)) {
+ RI_ERR("unknown jpeg codec (%s)", codec.c_str());
+ return RI_CATEGORY_MJPEG_DECODER_NOT_SUPPORTED;
+ }
+
+ ri_resolution resolution_id = GetResolutionID(h_size);
+
+ if (resolution_id == RI_RESOLUTION_UNDEFINED) {
+ RI_ERR("failed to get resolution id (%d)", h_size);
+ return RI_CATEGORY_MJPEG_DECODER_NOT_SUPPORTED;
+ }
+
+ ri_rsc_category_e category_id = RI_JPEG_DECODER_CATEGORY[jpeg_codec_id][resolution_id];
+
+ return CResourceInfoDB::GetInstance()->IsSupportedMJpegFormat(category_id);
+}
+
+ri_resolution CResourceInfo::GetResolutionID(int resolution)
+{
+ ri_resolution result = RI_RESOLUTION_UNDEFINED;
+
+ if (resolution < FHD_W && resolution > 0) {
+ result = RI_RESOLUTION_FHD;
+ } else if (resolution > FHD_W && resolution <= UHD_4K_W) {
+ result = RI_RESOLUTION_4K_UHD;
+ } else {
+ result = RI_RESOLUTION_8K_UHD;
+ }
+
+ return result;
+}
+
+ri_resolution CResourceInfo::GetResolutionID(const std::string codec_name, const int w, const int h)
+{
+ std::string name = (!codec_name.compare(RI_CODEC_NAME_H264_MVC)) ? RI_CODEC_NAME_H264 : codec_name;
+
+ CVideoCodec *codec = CResourceInfoDB::GetInstance()->FindVideoCodec(name);
+ if (!codec)
+ return RI_RESOLUTION_UNDEFINED;
+
+ return codec->GetResolutionID(w, h);
+}
+
+ri_resolution CResourceInfo::GetResolutionID(int w, int h, bool n_decoding, std::string codec_name)
+{
+ ri_resolution result = RI_RESOLUTION_UNDEFINED;
+
+ if (w <= 0 || h <= 0) {
+ RI_ERR("not supported (%d * %d)", w, h);
+ return RI_RESOLUTION_UNDEFINED;
+ }
+
+ result = GetResolutionID(codec_name, w, h);
+
+ if (!n_decoding) {
+ if (result == RI_RESOLUTION_HD || result == RI_RESOLUTION_qHD)
+ result = RI_RESOLUTION_FHD;
+ }
+
+ RI_INFO("video resolution(%d) by w(%d) & h(%d)", result, w, h);
+ return result;
+}
+
+// LCOV_EXCL_START
+int CResourceInfo::ToPortraitCategory(int category)
+{
+ int result = category;
+ switch(category) {
+ case RI_CATEGORY_VIDEO_DECODER_H264_UHD_8BIT_30P:
+ result = RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_30P_PORTRAIT;
+ break;
+ case RI_CATEGORY_VIDEO_DECODER_H264_UHD_8BIT_60P:
+ result = RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_60P_PORTRAIT;
+ break;
+ default:
+ break;
+ }
+
+ RI_INFO("(%d > %d)", category, result);
+ return result;
+}
+// LCOV_EXCL_END
+
+bool CResourceInfo::IsValidImageResolution(std::string codec, int w, int h)
+{
+ if (w <= 0 || h <= 0) {
+ RI_ERR("not supported (%d * %d)", w, h);
+ return false;
+ }
+
+ int max_w = 0;
+ int max_h = 0;
+ int min_w = 0;
+ int min_h = 0;
+
+ CResourceInfoDB::GetInstance()->GetImageMinMaxResolution(codec, &min_w, &min_h, &max_w, &max_h);
+ if (w > max_w || h > max_h) {
+ RI_ERR("[%s] not supported (%d * %d), max(%d * %d)", codec.c_str(), w, h, max_w, max_h);
+ return false;
+ }
+
+ if (w < min_w || h < min_h) {
+ RI_ERR("[%s] not supported (%d * %d), min(%d * %d)", codec.c_str(), w, h, min_w, min_h);
+ return false;
+ }
+
+ return true;
+}
+
+ri_resolution CResourceInfo::GetImageResolutionID(std::string codec, int w, int h)
+{
+ if (!IsValidImageResolution(codec, w, h))
+ return RI_RESOLUTION_UNDEFINED;
+
+ ri_resolution result = RI_RESOLUTION_FHD;
+
+ if (!IS_FHD_RESOLUTION_HORIZONTAL(w, h)) {
+ result = IS_4K_RESOLUTION_HORIZONTAL(w, h) ? RI_RESOLUTION_4K_UHD:RI_RESOLUTION_8K_UHD;
+ }
+
+ return result;
+}
+
+ri_rsc_category_e CResourceInfo::GetSubJpegCategoryID(const char *codec_name,int w_size,int h_size)
+{
+ int jpeg_codec_id = RI_JPEG_CODEC_JPEG;
+
+ if (!codec_name) {
+ RI_ERR("invalid param");
+ return RI_CATEGORY_JPEG_DECODER_NOT_SUPPORTED;
+ }
+
+ RI_INFO("codec(%s)/w(%d)/h(%d)", codec_name, w_size, h_size);
+
+ std::string codec(codec_name);
+
+ if (codec.compare(RI_CODEC_NAME_JPEG)) {
+ RI_ERR("unknown jpeg codec (%s)", codec.c_str());
+ return RI_CATEGORY_JPEG_DECODER_NOT_SUPPORTED;
+ }
+
+ ri_resolution resolution_id = GetImageResolutionID(codec, w_size, h_size);
+
+ if (resolution_id == RI_RESOLUTION_UNDEFINED)
+ return RI_CATEGORY_JPEG_DECODER_NOT_SUPPORTED;
+
+ ri_rsc_category_e category_id = RI_JPEG_DECODER_CATEGORY[jpeg_codec_id][resolution_id];
+
+ if (resolution_id == RI_RESOLUTION_8K_UHD) {
+ bool dec_8k_exist = (CResourceInfoDB::GetInstance()->IsSupportedJpegFormat(category_id) == RI_CATEGORY_JPEG_DECODER_NOT_SUPPORTED) ?false:true;
+
+ category_id = (!dec_8k_exist) ?RI_CATEGORY_JPEG_DECODER_UHD:RI_CATEGORY_JPEG_DECODER_8K;
+ }
+
+ return CResourceInfoDB::GetInstance()->IsSupportedJpegFormat(category_id);
+}
+// LCOV_EXCL_START
+ri_rsc_category_e CResourceInfo::GetHEICCategoryID(const char *codec_name, int w_size, int h_size)
+{
+ std::string codec(codec_name);
+
+ ri_resolution resolution_id = GetImageResolutionID(codec, w_size, h_size);
+ if (resolution_id == RI_RESOLUTION_UNDEFINED)
+ return RI_CATEGORY_IMAGE_DECODER_NOT_SUPPORTED;
+
+ return CResourceInfoDB::GetInstance()->IsSupportedImageFormat(RI_CATEGORY_HEIC_DECODER);
+}
+
+ri_rsc_category_e CResourceInfo::GetImageCategoryID(const char *codec_name, int w_size, int h_size)
+{
+ ri_rsc_category_e result;
+ std::string codec(codec_name);
+
+ if (!codec.compare(RI_CODEC_NAME_JPEG)) {
+ result = GetSubJpegCategoryID(codec_name, w_size, h_size);
+ return (result == RI_CATEGORY_JPEG_DECODER_NOT_SUPPORTED) ? RI_CATEGORY_IMAGE_DECODER_NOT_SUPPORTED:result;
+ }
+
+ if (!codec.compare(RI_CODEC_NAME_HEIC))
+ return GetHEICCategoryID(codec_name, w_size, h_size);
+
+ RI_ERR("not supported (%s)", codec_name);
+ return RI_CATEGORY_IMAGE_DECODER_NOT_SUPPORTED;
+}
+// LCOV_EXCL_END
+
+ri_color_depth CResourceInfo::GetColorDepthID(int color_depth, int sampling_format)
+{
+ if (color_depth == 8) { //sampling_format, RI_SAMPLING_FORMAT_OTHERS
+ return RI_COLOR_DEPTH_8BIT;
+ } else if (color_depth == 10 && sampling_format == RI_SAMPLING_FORMAT_420) {
+ return RI_COLOR_DEPTH_10BIT_420;
+ } else if (color_depth == 10 && sampling_format == RI_SAMPLING_FORMAT_422) {
+ return RI_COLOR_DEPTH_10BIT_422;
+ } else if (color_depth == 10) { //sampling_format, RI_SAMPLING_FORMAT_OTHERS
+ return RI_COLOR_DEPTH_10BIT;
+ } else {
+ RI_ERR("unknown color depth (%d)\n", color_depth);
+ return (ri_color_depth)-1;
+ }
+}
+
+ri_framerate CResourceInfo::GetFrameRateID(int framerate)
+{
+ ri_framerate framerate_e = RI_FRAMERATE_UNDEFINED;
+
+ if (IS_FRAMERATE_30P(framerate)) {
+ framerate_e = RI_FRAMERATE_30;
+ } else if (IS_FRAMERATE_60P(framerate)) {
+ framerate_e = RI_FRAMERATE_60;
+ } else if (IS_FRAMERATE_120P(framerate)) {
+ framerate_e = RI_FRAMERATE_120;
+ } else {
+ RI_ERR("unexpected frame rate (%d)\n", framerate);
+ }
+
+ return framerate_e;
+}
+
+// LCOV_EXCL_START
+int CResourceInfo::GetMixingOption(ri_audio_mixing_mode mixing_mode)
+{
+ int result = -1;
+
+ switch(mixing_mode) {
+ case RI_MIXING_MODE_DEFAULT:
+ result = RI_MIXING_OPT_DEFAULT;
+ break;
+ case RI_MIXING_MODE_MULTIVIEW:
+ result = RI_MIXING_OPT_MULTIVIEW;
+ break;
+ case RI_MIXING_MODE_INTERACTION_SOUND:
+ result = RI_MIXING_OPT_INTERACTION_SOUND;
+ break;
+ default:
+ RI_ERR("undefined mixing mode(%d)", mixing_mode);
+ result = RI_MIXING_OPT_DEFAULT;
+ break;
+ }
+
+ return result;
+}
+
+bool CResourceInfo::IsNormalMode(void)
+{
+ const char *rsc_event_name = "/tmp/.rsc_policy_activated";
+ //return (LwipcWaitEvent(rsc_event_name, 0) == 0;
+
+ return access(rsc_event_name, F_OK) == 0;
+}
+
+int CResourceInfo::GetCapableAudioDecoderCategoryID(ri_audio_category_option_request_s* option)
+{
+ if (!option || !option->codec_name) {
+ RI_ERR("invalid parameter!");
+ return RI_CATEGORY_AUDIO_DECODER_NOT_SUPPORTED;
+ }
+
+ int mixing_option = GetMixingOption(option->mixing_mode);
+ if (mixing_option < 0) {
+ RI_ERR("invalid mixing mode(%d)", option->mixing_mode);
+ return RI_CATEGORY_AUDIO_DECODER_NOT_SUPPORTED;
+ }
+
+ int category_id = CResourceInfoDB::GetInstance()->GetAudioDecoderCategoryId(option->codec_name);
+
+ RI_INFO("codec(%s)/mixing(%d)/result(%d)", option->codec_name, option->mixing_mode, category_id);
+
+ if (category_id == RI_CATEGORY_AUDIO_DECODER_NOT_SUPPORTED)
+ return category_id;
+
+ if (option->mixing_mode == RI_MIXING_MODE_MULTIVIEW && IsNormalMode()) {
+ RI_INFO("normal mode : category id (%d > %d)", category_id, RI_CATEGORY_AUDIO_DECODER);
+ return RI_CATEGORY_AUDIO_DECODER;
+ }
+
+ return (category_id | mixing_option);
+}
+// LCOV_EXCL_STOP
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#include <stdio.h>\r
-#include <string.h>\r
-#include <assert.h>\r
-#include <pthread.h>\r
-\r
-#include <system_info.h>\r
-\r
-#include <ri-resource-info-parser.h>\r
-#include <CCategoryElement.h>\r
-#include <CDeviceElement.h>\r
-#include <CModelInfo.h>\r
-#include <CVideoCodec.h>\r
-#include <CVideoCodecNDecoding.h>\r
-#include <CategoryIdBuilderMPEG1.h>\r
-#include <CategoryIdBuilderMPEG2.h>\r
-#include <CategoryIdBuilderMPEG4.h>\r
-#include <CategoryIdBuilderH263.h>\r
-#include <CategoryIdBuilderH264.h>\r
-#include <CategoryIdBuilderHEVC.h>\r
-#include <CategoryIdBuilderVP8.h>\r
-#include <CategoryIdBuilderVP9.h>\r
-#include <CategoryIdBuilderRV.h>\r
-#include <CategoryIdBuilderWMV.h>\r
-#include <CategoryIdBuilderAVS.h>\r
-#include <CategoryIdBuilderAVSPlus.h>\r
-#include <CategoryIdBuilderH264MVC.h>\r
-#include <CategoryIdBuilderHEVCvr360.h>\r
-#include <CategoryIdBuilderH264vr360.h>\r
-#include <CategoryIdBuilderVP9vr360.h>\r
-#include <CategoryIdBuilderSHVC.h>\r
-#include <CategoryIdBuilderAV1.h>\r
-#include <CategoryIdBuilderAV1vr360.h>\r
-#include <CategoryIdBuilderAVS2.h>\r
-#include <CategoryIdBuilderAVS3.h>\r
-#include <CategoryIdBuilderVVC.h>\r
-#include <CResourceInfoDB.h>\r
-\r
-static pthread_mutex_t db_instance_mutex = PTHREAD_MUTEX_INITIALIZER;\r
-\r
-CResourceInfoDB::CResourceInfoDB(void)\r
-{\r
- m_system_bw = 0;\r
-}\r
-\r
-CResourceInfoDB::~CResourceInfoDB(void){}\r
-\r
-CResourceInfoDB* CResourceInfoDB::m_instance = NULL;\r
-\r
-CResourceInfoDB* CResourceInfoDB::GetInstance(void)\r
-{\r
- pthread_mutex_lock(&db_instance_mutex);\r
-\r
- if (m_instance == NULL) {\r
- m_instance = new CResourceInfoDB;\r
- ParseXMLFile(static_cast<void*>(m_instance));\r
- m_instance->InitVideoDecCategories();\r
- }\r
-\r
- pthread_mutex_unlock(&db_instance_mutex);\r
- return m_instance;\r
-}\r
-\r
-ri_rsc_category_e CResourceInfoDB::IsSupportedVideoFormat(ri_rsc_category_e category_id)\r
-{\r
- std::set<int>::iterator iter = m_supported_video_format.find(category_id);\r
-\r
- return (iter == m_supported_video_format.end()) ? RI_CATEGORY_VIDEO_DECODER_NOT_SUPPORTED : category_id;\r
-}\r
-\r
-// LCOV_EXCL_START\r
-ri_rsc_category_e CResourceInfoDB::IsNDecodingSupportedVideoFormat(ri_rsc_category_e category_id)\r
-{\r
- std::set<int>::iterator iter = m_n_decoding_supported_video_format.find(category_id);\r
-\r
- if (iter == m_n_decoding_supported_video_format.end()) {\r
- if (category_id != RI_CATEGORY_VIDEO_DECODER_H264_HD_8BIT_30P)\r
- return RI_CATEGORY_VIDEO_DECODER_NOT_SUPPORTED;\r
-\r
- iter = m_n_decoding_supported_video_format.find(RI_CATEGORY_VIDEO_DECODER_H264_FHD_N_8BIT_30P);\r
- return (iter == m_n_decoding_supported_video_format.end()) ? RI_CATEGORY_VIDEO_DECODER_NOT_SUPPORTED : RI_CATEGORY_VIDEO_DECODER_H264_FHD_N_8BIT_30P;\r
- } else {\r
- return category_id;\r
- }\r
-}\r
-// LCOV_EXCL_END\r
-\r
-ri_rsc_category_e CResourceInfoDB::IsSupportedJpegFormat(ri_rsc_category_e category_id)\r
-{\r
- std::set<int>::iterator iter = m_supported_jpeg_format.find(category_id);\r
-\r
- return (iter == m_supported_jpeg_format.end()) ? RI_CATEGORY_JPEG_DECODER_NOT_SUPPORTED : category_id;\r
-}\r
-\r
-ri_rsc_category_e CResourceInfoDB::IsSupportedMJpegFormat(ri_rsc_category_e category_id)\r
-{\r
- std::set<int>::iterator iter = m_supported_jpeg_format.find(category_id);\r
-\r
- return (iter == m_supported_jpeg_format.end()) ? RI_CATEGORY_MJPEG_DECODER_NOT_SUPPORTED : category_id;\r
-}\r
-\r
-void CResourceInfoDB::AddSupportedVideoFormat(ri_rsc_category_e decoder_id)\r
-{\r
- m_supported_video_format.insert(decoder_id);\r
-}\r
-\r
-void CResourceInfoDB::AddSupportedNDecoder(ri_rsc_category_e decoder_id)\r
-{\r
- m_n_decoding_supported_video_format.insert(decoder_id);\r
-}\r
-\r
-void CResourceInfoDB::AddSupportedNDecoder(std::string codec_name, ri_rsc_category_e category_id, int rsz, int framerate)\r
-{\r
- CVideoCodecNDecoding* codec = nullptr;\r
-\r
- auto it = m_n_decoding_codecs.find(codec_name);\r
- if (it == m_n_decoding_codecs.end()) {\r
- codec = new CVideoCodecNDecoding(codec_name, rsz, framerate);\r
- codec->SetCategoryId(category_id);\r
- m_n_decoding_codecs.insert(std::pair<std::string, CVideoCodecNDecoding*>(codec_name, codec));\r
- } else {\r
- codec = it->second;\r
- if (rsz > codec->GetMaxResolution()) {\r
- codec->SetMaxResolution(rsz);\r
- codec->SetMaxFramerate(framerate);\r
- codec->SetCategoryId(category_id);\r
- } else if ((rsz == codec->GetMaxResolution()) && (framerate > codec->GetMaxFramerate())) {\r
- codec->SetMaxFramerate(framerate);\r
- codec->SetCategoryId(category_id);\r
- }\r
- }\r
-}\r
-\r
-void CResourceInfoDB::AddSupportedJpegFormat(ri_rsc_category_e decoder_id)\r
-{\r
- m_supported_jpeg_format.insert(decoder_id);\r
-}\r
-\r
-void CResourceInfoDB::AddSupportedImageFormat(ri_rsc_category_e decoder_id)\r
-{\r
- m_supported_image_format.insert(decoder_id);\r
-}\r
-\r
-// LCOV_EXCL_START\r
-ri_rsc_category_e CResourceInfoDB::IsSupportedImageFormat(ri_rsc_category_e category_id)\r
-{\r
- auto iter = m_supported_image_format.find(category_id);\r
-\r
- return (iter == m_supported_image_format.end()) ? RI_CATEGORY_IMAGE_DECODER_NOT_SUPPORTED : category_id;\r
-}\r
-// LCOV_EXCL_END\r
-\r
-bool CResourceInfoDB::IsSupportedAudioCodec(std::string acodec)\r
-{\r
- auto it = m_supported_audio_codecs.find(acodec);\r
- bool result = (it != m_supported_audio_codecs.end());\r
- RI_INFO("acodec(%s:%d)", acodec.c_str(), result);\r
- return result;\r
-}\r
-\r
-void CResourceInfoDB::AddSupportedAudioCodec(std::string name, ri_rsc_category_e decoder_id)\r
-{\r
- auto it = m_supported_audio_codecs.find(name);\r
- if (it != m_supported_audio_codecs.end())\r
- return;\r
-\r
- m_supported_audio_codecs.insert(std::pair<std::string, ri_rsc_category_e>(name, decoder_id));\r
-}\r
-\r
-void CResourceInfoDB::AddCategoryResolution(ri_rsc_category_e category_id, int resolution)\r
-{\r
- m_category_resolution.insert(std::pair<int, int>(category_id, resolution));\r
-}\r
-\r
-// LCOV_EXCL_START\r
-int CResourceInfoDB::FindCategoryResolution(int category_id)\r
-{\r
- auto it = m_category_resolution.find(category_id);\r
- if (it == m_category_resolution.end()) {\r
- RI_ERR("category(%d) not found", category_id);\r
- return -1;\r
- }\r
- RI_INFO("category resolution(%d:%d)", category_id, it->second);\r
- return it->second;\r
-}\r
-// LCOV_EXCL_END\r
-\r
-void CResourceInfoDB::AddCategoryFramerate(ri_rsc_category_e category_id, int framerate)\r
-{\r
- m_category_framerate.insert(std::pair<int, int>(category_id, framerate));\r
-}\r
-\r
-// LCOV_EXCL_START\r
-int CResourceInfoDB::FindCategoryFramerate(int category_id)\r
-{\r
- auto it = m_category_framerate.find(category_id);\r
- if (it == m_category_framerate.end()) {\r
- RI_ERR("category(%d) not found", category_id);\r
- return -1;\r
- }\r
- RI_INFO("category framerate(%d:%d)", category_id, it->second);\r
- return it->second;\r
-}\r
-// LCOV_EXCL_END\r
-\r
-void CResourceInfoDB::AddVideoCodec(std::string name, int resolution, int framerate)\r
-{\r
- CVideoCodec *vcodec;\r
-\r
- if (name.empty())\r
- return;\r
-\r
- auto it = m_video_codecs.find(name);\r
- if (it == m_video_codecs.end()) {\r
- vcodec = new CVideoCodec(name, resolution, framerate, IsCodecSupporting2KPortrait(name));\r
- m_video_codecs.insert(std::pair<std::string, CVideoCodec*>(name, vcodec));\r
- } else {\r
- vcodec = it->second;\r
- if (resolution > vcodec->GetMaxResolution()) {\r
- vcodec->SetMaxResolution(resolution);\r
- vcodec->SetMaxFrameRate(framerate);\r
- } else if (framerate > vcodec->GetMaxFrameRate()) {\r
- vcodec->SetMaxFrameRate(framerate);\r
- }\r
- }\r
-\r
- if (resolution == RI_RESOLUTION_QuadHD || resolution == RI_RESOLUTION_DQHD || resolution == RI_RESOLUTION_5K)\r
- vcodec->CreateExtraResolution(resolution);\r
-}\r
-\r
-// LCOV_EXCL_START\r
-ri_rsc_category_e CResourceInfoDB::GetAudioDecoderCategoryId(const char *codec_name)\r
-{\r
- auto it = m_supported_audio_codecs.find(std::string(codec_name));\r
- return (it == m_supported_audio_codecs.end()) ? RI_CATEGORY_AUDIO_DECODER_NOT_SUPPORTED : it->second;\r
-}\r
-\r
-int CResourceInfoDB::GetCategoryClass(int category_id)\r
-{\r
- auto it = m_resource_categories.find(category_id);\r
-\r
- return (it == m_resource_categories.end()) ? 0 : it->second->class_id;;\r
-}\r
-// LCOV_EXCL_END\r
-\r
-void CResourceInfoDB::AddCategoryInfo(ri_resource_category_s* category)\r
-{\r
- assert(category);\r
- m_resource_categories.insert(std::pair<int, ri_resource_category_s*>(category->id, category));\r
-}\r
-\r
-void CResourceInfoDB::AddDeviceAttributes(ri_device_common_attr_s* device_attr)\r
-{\r
- assert(device_attr);\r
-\r
- if (IsScaler(device_attr->category)) {\r
- m_scalers.insert(std::pair<int, ri_device_common_attr_s*>(device_attr->id, device_attr));\r
- m_n_scalers = m_scalers.size();\r
- }\r
-\r
- m_device_attr_map_by_dev_id.insert(std::pair<int, ri_device_common_attr_s*>(device_attr->id, device_attr));\r
-}\r
-\r
-void CResourceInfoDB::AddDeviceUniqueAttributes(IN const int id_unique, IN ri_device_unique_attr_s* device_attr)\r
-{\r
- m_device_unique_attr.insert(std::pair<int, ri_device_unique_attr_s*>(id_unique, device_attr));\r
-}\r
-\r
-bool CResourceInfoDB::HasDeviceUniqueAttributes(const int id_unique)\r
-{\r
- auto it = m_device_unique_attr.find(id_unique);\r
- return (it == m_device_unique_attr.end()) ? false:true;\r
-}\r
-\r
-ri_return_code_e CResourceInfoDB::GetCategoryType(int device_id, int* category_type)\r
-{\r
- std::map<int, ri_device_unique_attr_s*>::iterator iter = m_device_unique_attr.find(device_id);\r
-\r
- if (iter == m_device_unique_attr.end()) {\r
- if (IsVirtualDeviceIdScaler(device_id)) {\r
- RI_INFO("DevID[%d]/CatID[%d] Get Category type", device_id, RI_CATEGORY_SCALER);\r
- *category_type = RI_CATEGORY_SCALER;\r
- return RI_OK;\r
- }\r
-\r
- RI_ERR("DevID[%d] Cannot find category type", device_id);\r
- return RI_ERROR;\r
- }\r
-\r
- RI_INFO("DevID[%d:%s]/CatID[%d] Get Category type", iter->first, iter->second->name, iter->second->category);\r
-\r
- *category_type = iter->second->category;\r
-\r
- return RI_OK;\r
-}\r
-\r
-// LCOV_EXCL_START\r
-int CResourceInfoDB::GetMainCategory(IN int device_id)\r
-{\r
- auto it = m_device_unique_attr.find(device_id);\r
- if (it == m_device_unique_attr.end()) {\r
- RI_ERR("can't find main category(%d)", device_id);\r
- return 0;\r
- }\r
-\r
- return it->second->category;\r
-}\r
-\r
-std::string CResourceInfoDB::GetDeviceNodePathScaler(const int device_id)\r
-{\r
- auto it = m_scalers.begin();\r
- return (it == m_scalers.end()) ? std::string("") : std::string(it->second->path);\r
-}\r
-\r
-std::string CResourceInfoDB::GetDeviceNameScaler(const int device_id)\r
-{\r
- auto it = m_scalers.begin();\r
- return (it == m_scalers.end()) ? std::string("") : std::string(it->second->name);\r
-}\r
-\r
-ri_return_code_e CResourceInfoDB::GetDeviceNodePath(const int device_id, char** device_path)\r
-{\r
- std::map<int, ri_device_unique_attr_s*>::iterator iter = m_device_unique_attr.find(device_id);\r
- std::string path;\r
-\r
- if (iter == m_device_unique_attr.end()) {\r
- if (IsVirtualDeviceIdScaler(device_id)) {\r
- path = GetDeviceNodePathScaler(device_id);\r
- *device_path = strdup(path.c_str());\r
- RI_INFO("DEVICE ID : %d, DEVICE PATH : %s", device_id, *device_path);\r
- return RI_OK;\r
- }\r
- RI_INFO("DEVICE ID : %d CANNOT GET PATH", device_id);\r
- return RI_ERROR;\r
- }\r
-\r
- if (device_id == RI_DEVICE_UNDEFINED)\r
- return RI_ERROR;\r
-\r
- *device_path = strdup(iter->second->path);\r
-\r
- RI_INFO("DEVICE ID : %d, DEVICE PATH : %s", device_id, *device_path);\r
-\r
- return RI_OK;\r
-}\r
-\r
-const char *CResourceInfoDB::GetDeviceName(const int device_id)\r
-{\r
- std::map<int, ri_device_unique_attr_s*>::iterator iter = m_device_unique_attr.find(device_id);\r
- std::string name;\r
- if (iter == m_device_unique_attr.end()) {\r
- if (IsVirtualDeviceIdScaler(device_id)) {\r
- name = GetDeviceNameScaler(device_id);\r
- RI_INFO("DEVICE ID : %d, DEVICE NAME : %s", device_id, name.c_str());\r
- return strdup(name.c_str());\r
- }\r
-\r
- RI_INFO("[NULL] DEVICE ID : %d CANNOT GET NAME", device_id);\r
- return NULL;\r
- }\r
-\r
- if (device_id == RI_DEVICE_UNDEFINED) {\r
- RI_INFO("[NULL] DEVICE ID : %d RI_DEVICE_UNDEFINED", device_id);\r
- return NULL;\r
- }\r
-\r
- RI_INFO("DEVICE ID : %d, DEVICE NAME : %s", device_id, iter->second->name);\r
-\r
- return iter->second->name;\r
-}\r
-\r
-bool CResourceInfoDB::IsMainDevice(const int device_id)\r
-{\r
- auto it = m_device_unique_attr.find(device_id);\r
- if (it == m_device_unique_attr.end()) {\r
- RI_ERR("invalid device id (%d)", device_id);\r
- return false;\r
- }\r
- return it->second->main_device;\r
-}\r
-\r
-ri_return_code_e CResourceInfoDB::GetOmxCompName(const int device_id, char** name)\r
-{\r
- std::map<int, ri_device_unique_attr_s*>::iterator iter = m_device_unique_attr.find(device_id);\r
-\r
- if (iter == m_device_unique_attr.end()) {\r
- if (IsVirtualDeviceIdScaler(device_id)) {\r
- *name = strdup("");\r
- RI_INFO("DEVICE ID : %d, OMX COMPONENT NAME : %s", device_id, *name);\r
- return RI_OK;\r
- }\r
- return RI_ERROR;\r
- }\r
-\r
- if (device_id == RI_DEVICE_UNDEFINED)\r
- return RI_ERROR;\r
-\r
- *name = strdup(iter->second->omx_comp_name);\r
-\r
- RI_INFO("DEVICE ID : %d, OMX COMPONENT NAME : %s", device_id, *name);\r
-\r
- return RI_OK;\r
-}\r
-\r
-ri_return_code_e CResourceInfoDB::GetDeviceList(OUT int* num, OUT ri_device_common_attr_s** devices)\r
-{\r
- if (m_device_attr_map_by_dev_id.empty()) {\r
- if (ParseXMLFile(this) < 0) {\r
- RI_ERR("COULD NOT GET DEVICE INFO");\r
- return RI_ERROR;\r
- }\r
-\r
- InitVideoDecCategories();\r
- }\r
-\r
- *num = m_device_attr_map_by_dev_id.size();\r
- *devices = (ri_device_common_attr_s*) malloc (sizeof(ri_device_common_attr_s) * (*num));\r
- assert(*devices);\r
-\r
- unsigned int cnt = 0;\r
-\r
- for (auto const &it : m_device_attr_map_by_dev_id) {\r
- (*devices)[cnt].id = it.second->id;\r
- (*devices)[cnt].category = it.second->category;\r
- (*devices)[cnt].name = it.second->name;\r
- (*devices)[cnt].path = it.second->path;\r
- (*devices)[cnt].bw = it.second->bw;\r
-\r
- (*devices)[cnt].n_mem_clusters = it.second->n_mem_clusters;\r
- for (unsigned int i = 0; i < it.second->n_mem_clusters; i++)\r
- (*devices)[cnt].mem_clusters[i] = it.second->mem_clusters[i];\r
-\r
- (*devices)[cnt].sharable_count = it.second->sharable_count;\r
- (*devices)[cnt].mixing_count = it.second->mixing_count;\r
- (*devices)[cnt].is_uhd_device = it.second->is_uhd_device;\r
- (*devices)[cnt].id_unique = it.second->id_unique;\r
- (*devices)[cnt].is_main_device = it.second->is_main_device;\r
- (*devices)[cnt].audio_codec = it.second->audio_codec;\r
-\r
- int main_category = GetMainCategory(it.second->id_unique);\r
- (*devices)[cnt].category_main = (main_category != 0) ? main_category:it.second->category;\r
-\r
- cnt++;\r
- }\r
-\r
- return RI_OK;\r
-}\r
-\r
-\r
-int CResourceInfoDB::GetDeviceID(unsigned int category, unsigned int device_sz, int* device_id)\r
-{\r
- if (device_id == NULL) {\r
- RI_ERR("INVALID INPUT");\r
- return RI_ERROR;\r
- }\r
-\r
- unsigned int cnt = 0;\r
-\r
- for (std::map<int, ri_device_common_attr_s*>::iterator iter = m_device_attr_map_by_dev_id.begin(); iter != m_device_attr_map_by_dev_id.end(); iter++) {\r
- if (iter->second->category == category) {\r
- device_id[cnt] = iter->second->id;\r
- cnt++;\r
-\r
- if (cnt >= device_sz) {\r
- //RI_ERR("INVALID NUMBER");\r
- break;\r
- }\r
- }\r
- }\r
-\r
- if (cnt == 0) {\r
- RI_ERR("no device according to category(%d)", category);\r
- return RI_ERROR;\r
- }\r
-\r
- return RI_OK;\r
-}\r
-\r
-ri_device_common_attr_s* CResourceInfoDB::GetDeviceAttr(int device_id)\r
-{\r
- auto it = m_device_attr_map_by_dev_id.find(device_id);\r
-\r
- if (it == m_device_attr_map_by_dev_id.end()) {\r
- RI_ERR("cannot find device_attr according to device_id(%d)", device_id);\r
- return NULL;\r
- }\r
-\r
- return it->second;\r
-}\r
-// LCOV_EXCL_STOP\r
-\r
-bool CResourceInfoDB::GetDeviceNodePathNames(int category, char** device_node)\r
-{\r
- for (std::map<int, ri_device_common_attr_s*>::iterator iter = m_device_attr_map_by_dev_id.begin(); iter != m_device_attr_map_by_dev_id.end(); iter++) {\r
- if (iter->second->category == (unsigned int)category) {\r
- *device_node = strndup(iter->second->path, strlen(iter->second->path));\r
- return true;\r
- }\r
- }\r
- RI_INFO("cat[%d] has no device", category);\r
- return false;\r
-}\r
-\r
-bool CResourceInfoDB::GetClassOptions(const char *codec, ri_video_decoder_class_e class_value, bool* is_uhd_decoder, int* class_cat, bool* is_class_uhd, char** class_device_node)\r
-{\r
- int low_class = 99999;\r
- int high_class = 0; //uhd\r
- bool is_exist = false;\r
- char *tmp_device_node = NULL;\r
- std::string codec_name;\r
-\r
- for (auto &iter : m_resource_categories) {\r
- ri_resource_category_s* category = iter.second;\r
-\r
- if (!category)\r
- continue;\r
- if ((category->class_id == 0) || (category->class_id >= 100))\r
- continue;\r
-\r
- codec_name.assign(category->codec);\r
- if (!codec_name.compare(codec) && GetDeviceNodePathNames(category->id, &tmp_device_node)) {\r
- if (class_value == RI_VIDEO_CATEGORY_CLASS_LOW) {\r
- if (low_class > category->class_id) {\r
- low_class = category->class_id;\r
- *is_class_uhd = category->is_uhd_device;\r
- *class_cat = category->id;\r
-\r
- if (*class_device_node)\r
- free(*class_device_node);\r
- *class_device_node = strndup(tmp_device_node, strlen(tmp_device_node));\r
- }\r
- } else if (class_value == RI_VIDEO_CATEGORY_CLASS_HIGH) {\r
- if (high_class < category->class_id) {\r
- high_class = category->class_id;\r
- *is_class_uhd = category->is_uhd_device;\r
- *class_cat = category->id;\r
-\r
- if (*class_device_node)\r
- free(*class_device_node);\r
- *class_device_node = strndup(tmp_device_node, strlen(tmp_device_node));\r
- }\r
- }\r
- RI_INFO("found it!! CODEC[%s] category[%d/%s] %s", category->codec, category->id, category->name, (*is_uhd_decoder == true) ? "UHDdecoder" : "");\r
- is_exist = true;\r
- }\r
-\r
- if (tmp_device_node) {\r
- free(tmp_device_node);\r
- tmp_device_node = NULL;\r
- }\r
- }\r
-\r
- return is_exist;\r
-}\r
-ri_return_code_e CResourceInfoDB::GetCategoryOption(const char *codec, ri_video_decoder_class_e class_value, int *category_option, bool *is_uhd_decoder, char **device_node)\r
-{\r
- bool is_class_uhd = false;\r
- int class_cat = 0;\r
- char *class_device_node = NULL;\r
-\r
- *category_option = RI_CATEGORY_VIDEO_DECODER_NOT_SUPPORTED;\r
- *is_uhd_decoder = false;\r
- *device_node = NULL;\r
-\r
- if (!GetClassOptions(codec, class_value, is_uhd_decoder, &class_cat, &is_class_uhd, &class_device_node)) {\r
- RI_ERR("No resource category corresponding with requested info (codec:%s)", codec);\r
- return RI_ERROR;\r
- }\r
-\r
- if (!class_device_node)\r
- return RI_ERROR;\r
-\r
- *category_option = class_cat;\r
- *is_uhd_decoder = is_class_uhd;\r
- *device_node = strndup(class_device_node, strlen(class_device_node));\r
-\r
- RI_INFO("%s class request. ret option[%d]. is_uhd[%s]. node[%s]", (class_value ? "High" : "Low"),*category_option, (*is_uhd_decoder == true) ?"true":"false", *device_node);\r
-\r
- free(class_device_node);\r
- return RI_OK;\r
-}\r
-\r
-// LCOV_EXCL_START\r
-unsigned int CResourceInfoDB::GetDeviceID(char *node)\r
-{\r
- unsigned int id = 0;\r
- std::string path;\r
-\r
- for (std::map<int, ri_device_common_attr_s*>::iterator iter = m_device_attr_map_by_dev_id.begin(); iter != m_device_attr_map_by_dev_id.end(); iter++) {\r
- path.assign(iter->second->path);\r
- if (!path.compare(node))\r
- id = (int)(iter->second->id_unique);\r
- }\r
-\r
- RI_INFO("device node[%s] - device id[%d]", node, id);\r
- return id;\r
-}\r
-// LCOV_EXCL_STOP\r
-\r
-ri_return_code_e CResourceInfoDB::GetDefaultDeviceNodePath(ri_rsc_category_e category, char** node)\r
-{\r
- for (std::map<int, ri_device_common_attr_s*>::iterator iter = m_device_attr_map_by_dev_id.begin(); iter != m_device_attr_map_by_dev_id.end(); iter++) {\r
- if (iter->second->category == (unsigned int)category) {\r
- *node = strndup(iter->second->path, strlen(iter->second->path));\r
- RI_INFO("category[%d] node[%s]", (unsigned int)category, *node);\r
-\r
- return RI_OK;\r
- }\r
- }\r
-\r
- return RI_ERROR;\r
-}\r
-\r
-// LCOV_EXCL_START\r
-\r
-void CResourceInfoDB::PrintDeviceUniqueInfo(void)\r
-{\r
- for (std::map<int, ri_device_unique_attr_s*>::iterator iter = m_device_unique_attr.begin(); iter != m_device_unique_attr.end(); iter++) {\r
- RI_DBG("DevID[%d:%s]/CatID[%d]", iter->first, iter->second->name, iter->second->category);\r
- }\r
-}\r
-// LCOV_EXCL_STOP\r
-\r
-// LCOV_EXCL_START\r
-bool CResourceInfoDB::IsVideoDecoderCategory(ri_rsc_category_e vdec)\r
-{\r
- if (vdec > RI_CATEGORY_VIDEO_DECODER_OPTION && vdec < RI_VIDEO_CATEGORY_MAX)\r
- return true;\r
- if (vdec == RI_CATEGORY_VIDEO_DECODER || vdec == RI_CATEGORY_VIDEO_DECODER_SUB)\r
- return true;\r
-\r
- return false;\r
-}\r
-\r
-bool CResourceInfoDB::IsAudioDecoderCategory(ri_rsc_category_e adec)\r
-{\r
- if (adec > RI_CATEGORY_AUDIO_DECODER_OPTION && adec < RI_AUDIO_CATEGORY_MAX)\r
- return true;\r
- if (adec == RI_CATEGORY_AUDIO_DECODER || adec == RI_CATEGORY_AUDIO_DECODER_SUB)\r
- return true;\r
-\r
- return false;\r
-}\r
-\r
-bool CResourceInfoDB::IsAudioDecoderCategoryForMixing(ri_rsc_category_e adec)\r
-{\r
- return (adec > RI_CATEGORY_AUDIO_DECODER_OPTION && adec < RI_AUDIO_CATEGORY_MAX) ? true:false;\r
-}\r
-\r
-bool CResourceInfoDB::IsMJpegDecoderCategory(ri_rsc_category_e category)\r
-{\r
- if (category > RI_CATEGORY_MJPEG_DECODER_OPTION && category <= RI_CATEGORY_MJPEG_DECODER_8K)\r
- return true;\r
- if (category == RI_CATEGORY_MJPEG_DECODER)\r
- return true;\r
-\r
- return false;\r
-}\r
-\r
-int CResourceInfoDB::GetAIDecoderCategoryId(ri_rsc_category_e vdec)\r
-{\r
- // This feature is deprecated since Tizen6.5 because there is no chipset requiring upscaling\r
- RI_INFO("vdec : (%d)", vdec);\r
- return vdec;\r
-}\r
-// LCOV_EXCL_STOP\r
-\r
-CVideoCodec* CResourceInfoDB::FindVideoCodec(std::string name)\r
-{\r
- auto it = m_video_codecs.find(name);\r
- return (it == m_video_codecs.end()) ? NULL : it->second;\r
-}\r
-\r
-CVideoCodecNDecoding *CResourceInfoDB::FindNDecodingVideoCodec(std::string codec_name)\r
-{\r
- auto it = m_n_decoding_codecs.find(codec_name);\r
- return (it == m_n_decoding_codecs.end()) ? NULL : it->second;\r
-}\r
-\r
-// LCOV_EXCL_START\r
-bool CResourceInfoDB::IsVirtualDeviceIdScaler(int device_id)\r
-{\r
- if (device_id < RI_VIRTUAL_ID_SCALER)\r
- return false;\r
-\r
- int id_max = (RI_VIRTUAL_ID_SCALER + m_n_scalers - 1);\r
-\r
- return (device_id <= id_max);\r
-}\r
-\r
-bool CResourceInfoDB::IsScaler(int category)\r
-{\r
- bool result = false;\r
-\r
- switch(category) {\r
- case RI_CATEGORY_SCALER:\r
- case RI_CATEGORY_SCALER_SUB:\r
- case RI_CATEGORY_SCALER_SUB2:\r
- case RI_CATEGORY_SCALER_SUB3:\r
- case RI_CATEGORY_SCALER_BG:\r
- result = true;\r
- break;\r
- default:\r
- break;\r
- }\r
-\r
- return result;\r
-}\r
-// LCOV_EXCL_STOP\r
-\r
-CCategoryIdBuilder* CResourceInfoDB::GetVideoDecCategoryBuilder(std::string codec_name)\r
-{\r
- if (!codec_name.compare(std::string(RI_CODEC_NAME_MPEG1)))\r
- return new CategoryIdBuilderMPEG1();\r
-\r
- if (!codec_name.compare(std::string(RI_CODEC_NAME_MPEG2)))\r
- return new CategoryIdBuilderMPEG2();\r
-\r
- if (!codec_name.compare(std::string(RI_CODEC_NAME_MPEG4)))\r
- return new CategoryIdBuilderMPEG4();\r
-\r
- if (!codec_name.compare(std::string(RI_CODEC_NAME_H263)))\r
- return new CCategoryIdBuilderH263();\r
-\r
- if (!codec_name.compare(std::string(RI_CODEC_NAME_H264)))\r
- return new CategoryIdBuilderH264();\r
-\r
- if (!codec_name.compare(std::string(RI_CODEC_NAME_HEVC)))\r
- return new CategoryIdBuilderHEVC();\r
-\r
- if (!codec_name.compare(std::string(RI_CODEC_NAME_VP8)))\r
- return new CategoryIdBuilderVP8();\r
-\r
- if (!codec_name.compare(std::string(RI_CODEC_NAME_VP9)))\r
- return new CategoryIdBuilderVP9();\r
-\r
- if (!codec_name.compare(std::string(RI_CODEC_NAME_RV)))\r
- return new CategoryIdBuilderRV();\r
-\r
- if (!codec_name.compare(std::string(RI_CODEC_NAME_WMV)))\r
- return new CategoryIdBuilderWMV();\r
-\r
- if (!codec_name.compare(std::string(RI_CODEC_NAME_AVS)))\r
- return new CategoryIdBuilderAVS();\r
-\r
- if (!codec_name.compare(std::string(RI_CODEC_NAME_AVS_PLUS)))\r
- return new CategoryIdBuilderAVSPlus();\r
-\r
- if (!codec_name.compare(std::string(RI_CODEC_NAME_H264_MVC)))\r
- return new CategoryIdBuilderH264MVC();\r
-\r
- if (!codec_name.compare(std::string(RI_CODEC_NAME_HEVC_VR360)))\r
- return new CategoryIdBuilderHEVCvr360();\r
-\r
- if (!codec_name.compare(std::string(RI_CODEC_NAME_H264_VR360)))\r
- return new CategoryIdBuilderH264vr360();\r
-\r
- if (!codec_name.compare(std::string(RI_CODEC_NAME_VP9_VR360)))\r
- return new CategoryIdBuilderVP9vr360();\r
-\r
- if (!codec_name.compare(std::string(RI_CODEC_NAME_HEVC_SHVC)))\r
- return new CategoryIdBuilderSHVC();\r
-\r
- if (!codec_name.compare(std::string(RI_CODEC_NAME_AV1)))\r
- return new CategoryIdBuilderAV1();\r
-\r
- if (!codec_name.compare(std::string(RI_CODEC_NAME_AV1_VR360)))\r
- return new CategoryIdBuilderAV1vr360();\r
-\r
- if (!codec_name.compare(std::string(RI_CODEC_NAME_AVS2)))\r
- return new CategoryIdBuilderAVS2();\r
-\r
- if (!codec_name.compare(std::string(RI_CODEC_NAME_VVC)))\r
- return new CategoryIdBuilderVVC();\r
-\r
- if (!codec_name.compare(std::string(RI_CODEC_NAME_AVS3)))\r
- return new CategoryIdBuilderAVS3();\r
-\r
- RI_ERR("unexpected codec (%s)", codec_name.c_str());\r
- return nullptr;\r
-}\r
-\r
-struct video_2K_portrait_rsz_support{\r
- const char *codec_name;\r
- bool support;\r
-};\r
-\r
-bool CResourceInfoDB::IsCodecSupporting2KPortrait(std::string codec_name)\r
-{\r
- video_2K_portrait_rsz_support video_codecs[] = {\r
- {RI_CODEC_NAME_MPEG1, false},\r
- {RI_CODEC_NAME_MPEG2, false},\r
- {RI_CODEC_NAME_MPEG4, false},\r
- {RI_CODEC_NAME_H263, false},\r
- {RI_CODEC_NAME_H264, true},\r
- {RI_CODEC_NAME_HEVC, true},\r
- {RI_CODEC_NAME_VP8, false},\r
- {RI_CODEC_NAME_VP9, true},\r
- {RI_CODEC_NAME_RV, false},\r
- {RI_CODEC_NAME_WMV, false},\r
- {RI_CODEC_NAME_AVS, false},\r
- {RI_CODEC_NAME_AVS_PLUS, false},\r
- {RI_CODEC_NAME_H264_MVC, true},\r
- {RI_CODEC_NAME_HEVC_VR360, true},\r
- {RI_CODEC_NAME_H264_VR360, true},\r
- {RI_CODEC_NAME_VP9_VR360, true},\r
- {RI_CODEC_NAME_HEVC_SHVC, true},\r
- {RI_CODEC_NAME_AV1, true},\r
- {RI_CODEC_NAME_AV1_VR360, true},\r
- {RI_CODEC_NAME_AVS2, true},\r
- {RI_CODEC_NAME_AVS3, true},\r
- {RI_CODEC_NAME_VVC, true}\r
- };\r
-\r
- for (unsigned int i = 0; i < ARRAY_SIZE(video_codecs); i++) {\r
- if (!codec_name.compare(video_codecs[i].codec_name))\r
- return video_codecs[i].support;\r
- }\r
-\r
- RI_ERR("undefined video codec(%s)", codec_name.c_str());\r
- return false;\r
-}\r
-\r
-bool CResourceInfoDB::Support2KPortraitResolution(std::string codec_name)\r
-{\r
- CVideoCodec* codec = FindVideoCodec(codec_name);\r
-\r
- return (!codec) ? false:codec->Support2KPortraitResolution();\r
-}\r
-\r
-void CResourceInfoDB::InitVideoDecCategories(void)\r
-{\r
- const char *video_codecs[] = {\r
- RI_CODEC_NAME_MPEG1,\r
- RI_CODEC_NAME_MPEG2,\r
- RI_CODEC_NAME_MPEG4,\r
- RI_CODEC_NAME_H263,\r
- RI_CODEC_NAME_H264,\r
- RI_CODEC_NAME_HEVC,\r
- RI_CODEC_NAME_VP8,\r
- RI_CODEC_NAME_VP9,\r
- RI_CODEC_NAME_RV,\r
- RI_CODEC_NAME_WMV,\r
- RI_CODEC_NAME_AVS,\r
- RI_CODEC_NAME_AVS_PLUS,\r
- RI_CODEC_NAME_H264_MVC,\r
- RI_CODEC_NAME_HEVC_VR360,\r
- RI_CODEC_NAME_H264_VR360,\r
- RI_CODEC_NAME_VP9_VR360,\r
- RI_CODEC_NAME_HEVC_SHVC,\r
- RI_CODEC_NAME_AV1,\r
- RI_CODEC_NAME_AV1_VR360,\r
- RI_CODEC_NAME_AVS2,\r
- RI_CODEC_NAME_AVS3,\r
- RI_CODEC_NAME_VVC\r
- };\r
-\r
- std::string codec_name;\r
- CVideoDecoderCategory* vdec_category;\r
-\r
- for (unsigned int i = 0; i < ARRAY_SIZE(video_codecs); i++) {\r
- codec_name.assign(video_codecs[i]);\r
- vdec_category = new CVideoDecoderCategory(codec_name, GetVideoDecCategoryBuilder(codec_name));\r
- vdec_category->CreateCategoryIds();\r
- m_video_dec_categories.insert(std::pair<std::string, CVideoDecoderCategory*>(codec_name, vdec_category));\r
- }\r
-\r
-}\r
-\r
-int CResourceInfoDB::GetVideoDecCategoryId(std::string codec_name, int rsz_id, int framerate, int color_depth)\r
-{\r
- auto it = m_video_dec_categories.find(codec_name);\r
-\r
- //RI_INFO("size(%d) - codec name (%s)/rsz_id(%d)/framerate(%d)/color_depth(%d)", m_video_dec_categories.size(), codec_name.c_str(), rsz_id, framerate, color_depth);\r
-\r
- if (it == m_video_dec_categories.end()) {\r
- RI_ERR("codec not found (%s)", codec_name.c_str());\r
- return RI_CATEGORY_VIDEO_DECODER_NOT_SUPPORTED;\r
- }\r
-\r
- return it->second->FindVideoCategoryId(rsz_id, framerate, color_depth);\r
-}\r
-\r
-void CResourceInfoDB::SetImageMinMaxResolution(std::string codec, int w_min, int h_min, int w_max, int h_max)\r
-{\r
- CImageCodec *img = NULL;\r
- auto it = m_image_codecs.find(codec);\r
-\r
- if (it == m_image_codecs.end()) {\r
- img = new CImageCodec(codec);\r
- m_image_codecs.insert(std::pair<std::string, CImageCodec*>(codec, img));\r
- } else {\r
- img = it->second;\r
- }\r
-\r
- img->SetMaxResolution(w_max, h_max);\r
- img->SetMinResolution(w_min, h_min);\r
-}\r
-\r
-void CResourceInfoDB::GetImageMinMaxResolution(std::string codec, int *w_min, int *h_min, int *w_max, int *h_max)\r
-{\r
- auto it = m_image_codecs.find(codec);\r
- if (it == m_image_codecs.end()) {\r
- RI_ERR("not supported codec(%s)", codec.c_str());\r
- *w_min = 0;\r
- *h_min = 0;\r
- *w_max = 0;\r
- *h_max = 0;\r
- return;\r
- }\r
-\r
- CImageCodec *img = it->second;\r
- img->GetMaxResolution(w_max, h_max);\r
- img->GetMinResolution(w_min, h_min);\r
-}\r
-\r
-// LCOV_EXCL_START\r
-bool CResourceInfoDB::IsSupportOverlay(const int device_id)\r
-{\r
- auto it = m_device_unique_attr.find(device_id);\r
- return (it == m_device_unique_attr.end()) ? false : it->second->support_overlay;\r
-}\r
-\r
-int CResourceInfoDB::GetMaxResolution(const int device_id)\r
-{\r
- auto it = m_device_unique_attr.find(device_id);\r
- return (it == m_device_unique_attr.end()) ? 0 : it->second->max_rez;\r
-}\r
-\r
-int CResourceInfoDB::GetMaxSamplingFormat(const int device_id)\r
-{\r
- auto it = m_device_unique_attr.find(device_id);\r
- return (it == m_device_unique_attr.end()) ? 0 : it->second->max_sampling_format;\r
-}\r
-\r
-int CResourceInfoDB::ToNDecodingCategory(int category)\r
-{\r
- if (category == RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_30P)\r
- return RI_CATEGORY_VIDEO_DECODER_H264_FHD_N_8BIT_30P;\r
-\r
- return category;\r
-}\r
-\r
-int CResourceInfoDB::Set2KSize(std::string codec_name, int w, int h, int wp, int hp)\r
-{\r
- CVideoCodec* codec = FindVideoCodec(codec_name);\r
- if (!codec) {\r
- RI_ERR("codec(%s) not found", codec_name.c_str());\r
- return -1;\r
- }\r
-\r
- codec->SetResolutionSize(RI_RESOLUTION_FHD, w, h, wp, hp);\r
- return 0;\r
-}\r
-\r
-int CResourceInfoDB::Set4KSize(std::string codec_name, int w, int h, int wp, int hp)\r
-{\r
- CVideoCodec* codec = FindVideoCodec(codec_name);\r
- if (!codec) {\r
- RI_ERR("codec(%s) not found", codec_name.c_str());\r
- return -1;\r
- }\r
-\r
- codec->SetResolutionSize(RI_RESOLUTION_4K_UHD, w, h, wp, hp);\r
- return 0;\r
-}\r
-\r
-int CResourceInfoDB::Set8KSize(std::string codec_name, int w, int h, int wp, int hp)\r
-{\r
- CVideoCodec* codec = FindVideoCodec(codec_name);\r
- if (!codec) {\r
- RI_ERR("codec(%s) not found", codec_name.c_str());\r
- return -1;\r
- }\r
-\r
- codec->SetResolutionSize(RI_RESOLUTION_8K_UHD, w, h, wp, hp);\r
- return 0;\r
-}\r
-// LCOV_EXCL_STOP\r
-\r
-void CResourceInfoDB::AddVideoDecoder(int id, std::string codec_name, int rsz, int framerate)\r
-{\r
- const auto &it = m_video_decoders.find(id);\r
- if (it != m_video_decoders.end()) {\r
- it->second->InsertVideoCodec(codec_name, rsz, framerate);\r
- return;\r
- }\r
-\r
- CVideoDecoder *vdec = new CVideoDecoder(id);\r
- vdec->InsertVideoCodec(codec_name, rsz, framerate);\r
- m_video_decoders.insert(std::pair<int, CVideoDecoder *>(id, vdec));\r
-}\r
-\r
-// LCOV_EXCL_START\r
-int CResourceInfoDB::GetVideoDecoderList(ri_resource_list_h *list_out)\r
-{\r
- if (!list_out)\r
- return -1;\r
-\r
- ri_resource_list* vdec_list = (ri_resource_list*) calloc(1, sizeof(ri_resource_list));\r
- assert(vdec_list);\r
-\r
- for (const auto &it_vdec : m_video_decoders) {\r
- ri_video_decoder* vdec = (ri_video_decoder*) calloc(1, sizeof(ri_video_decoder));\r
- assert(vdec);\r
- vdec->id = it_vdec.second->GetId();\r
- RI_INFO("vdec->id : %d", vdec->id);\r
-\r
- std::map<std::string, CVideoCodec*> codecs = it_vdec.second->GetSupportedCodecs();\r
-\r
- for (const auto &it_codec : codecs) {\r
- ri_vcodec* vcodec = (ri_vcodec*) calloc(1, sizeof(ri_vcodec));\r
- assert(vcodec);\r
- vcodec->codec_name = strndup(it_codec.second->GetName().c_str(), it_codec.second->GetName().length());\r
- vcodec->rsz_id = it_codec.second->GetMaxResolution();\r
- vcodec->framerate = it_codec.second->GetMaxFrameRate();\r
- RI_INFO("vcodec name : %s, rsz_id : %d, framerate : %d", vcodec->codec_name, vcodec->rsz_id, vcodec->framerate);\r
- vdec->codec_list = g_list_append(vdec->codec_list, vcodec);\r
- }\r
- vdec->n_codecs = g_list_length(vdec->codec_list);\r
- RI_INFO("vdec->n_codecs : %d", vdec->n_codecs);\r
- vdec->iter = vdec->codec_list;\r
-\r
- vdec_list->rsc_list = g_list_append(vdec_list->rsc_list, vdec);\r
- }\r
-\r
- vdec_list->n_rsc = g_list_length(vdec_list->rsc_list);\r
- vdec_list->iter = vdec_list->rsc_list;\r
- *list_out = vdec_list;\r
-\r
- return 0;\r
-}\r
-\r
-std::string CResourceInfoDB::FindCategoryVideoCodecName(int category_id)\r
-{\r
- std::string codec_name("");\r
-\r
- auto it = m_resource_categories.find(category_id);\r
- if (it == m_resource_categories.end()) {\r
- RI_ERR("category not found(%d)", category_id);\r
- return codec_name;\r
- }\r
-\r
- ri_resource_category_s* cat = it->second;\r
- codec_name.assign(cat->codec);\r
-\r
- RI_INFO("category codec name (%d:%s)", category_id, codec_name.c_str());\r
- return codec_name;\r
-}\r
-// LCOV_EXCL_END\r
-\r
-int CResourceInfoDB::GetNumOfDeviceBelongsTo(int category_id)\r
-{\r
- auto it = m_resource_categories.find(category_id);\r
- if (it == m_resource_categories.end()) {\r
- RI_ERR("category not found(%d)", category_id);\r
- return 0;\r
- }\r
-\r
- ri_resource_category_s* category = it->second;\r
- RI_INFO("number of devices belongs to (%d) : (%d)", category_id, category->num_of_dev);\r
- return category->num_of_dev;\r
-}\r
-\r
-bool CResourceInfoDB::IsSupportedCategory(int category)\r
-{\r
- auto it = m_resource_categories.find(category);\r
- return (it != m_resource_categories.end());\r
-}\r
-\r
-void CResourceInfoDB::AddVideoCapability(const std::string codec, VideoCapability *capability)\r
-{\r
- if (!capability) {\r
- RI_ERR("invalid capability");\r
- return;\r
- }\r
-\r
- RI_INFO("(%s:%s:%d:%d:%d)", codec.c_str(), capability->GetDeviceProperty().c_str(), capability->GetWidth(), capability->GetHeight(), capability->GetFPS());\r
-\r
- auto it = video_capabilities_.find(codec);\r
- if (it == video_capabilities_.end()) {\r
- std::vector<VideoCapability*> capabilities;\r
- capabilities.push_back(capability);\r
- video_capabilities_[codec] = capabilities;\r
- return;\r
- }\r
-\r
- it->second.push_back(capability);\r
-}\r
-\r
-bool CResourceInfoDB::FindVideoCapability(const std::string codec, std::vector<VideoCapability*> &capabilities)\r
-{\r
- auto it = video_capabilities_.find(codec);\r
- if (it == video_capabilities_.end()) {\r
- RI_INFO("not found (%s)", codec.c_str());\r
- return false;\r
- }\r
-\r
- for (auto itc : it->second)\r
- capabilities.push_back(new VideoCapability(*itc));\r
-\r
- RI_INFO("found (%s:%zu)", codec.c_str(), capabilities.size());\r
- return true;\r
-}\r
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include <pthread.h>
+
+#include <system_info.h>
+
+#include <ri-resource-info-parser.h>
+#include <CCategoryElement.h>
+#include <CDeviceElement.h>
+#include <CModelInfo.h>
+#include <CVideoCodec.h>
+#include <CVideoCodecNDecoding.h>
+#include <CategoryIdBuilderMPEG1.h>
+#include <CategoryIdBuilderMPEG2.h>
+#include <CategoryIdBuilderMPEG4.h>
+#include <CategoryIdBuilderH263.h>
+#include <CategoryIdBuilderH264.h>
+#include <CategoryIdBuilderHEVC.h>
+#include <CategoryIdBuilderVP8.h>
+#include <CategoryIdBuilderVP9.h>
+#include <CategoryIdBuilderRV.h>
+#include <CategoryIdBuilderWMV.h>
+#include <CategoryIdBuilderAVS.h>
+#include <CategoryIdBuilderAVSPlus.h>
+#include <CategoryIdBuilderH264MVC.h>
+#include <CategoryIdBuilderHEVCvr360.h>
+#include <CategoryIdBuilderH264vr360.h>
+#include <CategoryIdBuilderVP9vr360.h>
+#include <CategoryIdBuilderSHVC.h>
+#include <CategoryIdBuilderAV1.h>
+#include <CategoryIdBuilderAV1vr360.h>
+#include <CategoryIdBuilderAVS2.h>
+#include <CategoryIdBuilderAVS3.h>
+#include <CategoryIdBuilderVVC.h>
+#include <CResourceInfoDB.h>
+
+static pthread_mutex_t db_instance_mutex = PTHREAD_MUTEX_INITIALIZER;
+
+CResourceInfoDB::CResourceInfoDB(void)
+{
+ m_system_bw = 0;
+}
+
+CResourceInfoDB::~CResourceInfoDB(void){}
+
+CResourceInfoDB* CResourceInfoDB::m_instance = NULL;
+
+CResourceInfoDB* CResourceInfoDB::GetInstance(void)
+{
+ pthread_mutex_lock(&db_instance_mutex);
+
+ if (m_instance == NULL) {
+ m_instance = new CResourceInfoDB;
+ ParseXMLFile(static_cast<void*>(m_instance));
+ m_instance->InitVideoDecCategories();
+ }
+
+ pthread_mutex_unlock(&db_instance_mutex);
+ return m_instance;
+}
+
+ri_rsc_category_e CResourceInfoDB::IsSupportedVideoFormat(ri_rsc_category_e category_id)
+{
+ std::set<int>::iterator iter = m_supported_video_format.find(category_id);
+
+ return (iter == m_supported_video_format.end()) ? RI_CATEGORY_VIDEO_DECODER_NOT_SUPPORTED : category_id;
+}
+
+// LCOV_EXCL_START
+ri_rsc_category_e CResourceInfoDB::IsNDecodingSupportedVideoFormat(ri_rsc_category_e category_id)
+{
+ std::set<int>::iterator iter = m_n_decoding_supported_video_format.find(category_id);
+
+ if (iter == m_n_decoding_supported_video_format.end()) {
+ if (category_id != RI_CATEGORY_VIDEO_DECODER_H264_HD_8BIT_30P)
+ return RI_CATEGORY_VIDEO_DECODER_NOT_SUPPORTED;
+
+ iter = m_n_decoding_supported_video_format.find(RI_CATEGORY_VIDEO_DECODER_H264_FHD_N_8BIT_30P);
+ return (iter == m_n_decoding_supported_video_format.end()) ? RI_CATEGORY_VIDEO_DECODER_NOT_SUPPORTED : RI_CATEGORY_VIDEO_DECODER_H264_FHD_N_8BIT_30P;
+ } else {
+ return category_id;
+ }
+}
+// LCOV_EXCL_END
+
+ri_rsc_category_e CResourceInfoDB::IsSupportedJpegFormat(ri_rsc_category_e category_id)
+{
+ std::set<int>::iterator iter = m_supported_jpeg_format.find(category_id);
+
+ return (iter == m_supported_jpeg_format.end()) ? RI_CATEGORY_JPEG_DECODER_NOT_SUPPORTED : category_id;
+}
+
+ri_rsc_category_e CResourceInfoDB::IsSupportedMJpegFormat(ri_rsc_category_e category_id)
+{
+ std::set<int>::iterator iter = m_supported_jpeg_format.find(category_id);
+
+ return (iter == m_supported_jpeg_format.end()) ? RI_CATEGORY_MJPEG_DECODER_NOT_SUPPORTED : category_id;
+}
+
+void CResourceInfoDB::AddSupportedVideoFormat(ri_rsc_category_e decoder_id)
+{
+ m_supported_video_format.insert(decoder_id);
+}
+
+void CResourceInfoDB::AddSupportedNDecoder(ri_rsc_category_e decoder_id)
+{
+ m_n_decoding_supported_video_format.insert(decoder_id);
+}
+
+void CResourceInfoDB::AddSupportedNDecoder(std::string codec_name, ri_rsc_category_e category_id, int rsz, int framerate)
+{
+ CVideoCodecNDecoding* codec = nullptr;
+
+ auto it = m_n_decoding_codecs.find(codec_name);
+ if (it == m_n_decoding_codecs.end()) {
+ codec = new CVideoCodecNDecoding(codec_name, rsz, framerate);
+ codec->SetCategoryId(category_id);
+ m_n_decoding_codecs.insert(std::pair<std::string, CVideoCodecNDecoding*>(codec_name, codec));
+ } else {
+ codec = it->second;
+ if (rsz > codec->GetMaxResolution()) {
+ codec->SetMaxResolution(rsz);
+ codec->SetMaxFramerate(framerate);
+ codec->SetCategoryId(category_id);
+ } else if ((rsz == codec->GetMaxResolution()) && (framerate > codec->GetMaxFramerate())) {
+ codec->SetMaxFramerate(framerate);
+ codec->SetCategoryId(category_id);
+ }
+ }
+}
+
+void CResourceInfoDB::AddSupportedJpegFormat(ri_rsc_category_e decoder_id)
+{
+ m_supported_jpeg_format.insert(decoder_id);
+}
+
+void CResourceInfoDB::AddSupportedImageFormat(ri_rsc_category_e decoder_id)
+{
+ m_supported_image_format.insert(decoder_id);
+}
+
+// LCOV_EXCL_START
+ri_rsc_category_e CResourceInfoDB::IsSupportedImageFormat(ri_rsc_category_e category_id)
+{
+ auto iter = m_supported_image_format.find(category_id);
+
+ return (iter == m_supported_image_format.end()) ? RI_CATEGORY_IMAGE_DECODER_NOT_SUPPORTED : category_id;
+}
+// LCOV_EXCL_END
+
+bool CResourceInfoDB::IsSupportedAudioCodec(std::string acodec)
+{
+ auto it = m_supported_audio_codecs.find(acodec);
+ bool result = (it != m_supported_audio_codecs.end());
+ RI_INFO("acodec(%s:%d)", acodec.c_str(), result);
+ return result;
+}
+
+void CResourceInfoDB::AddSupportedAudioCodec(std::string name, ri_rsc_category_e decoder_id)
+{
+ auto it = m_supported_audio_codecs.find(name);
+ if (it != m_supported_audio_codecs.end())
+ return;
+
+ m_supported_audio_codecs.insert(std::pair<std::string, ri_rsc_category_e>(name, decoder_id));
+}
+
+void CResourceInfoDB::AddCategoryResolution(ri_rsc_category_e category_id, int resolution)
+{
+ m_category_resolution.insert(std::pair<int, int>(category_id, resolution));
+}
+
+// LCOV_EXCL_START
+int CResourceInfoDB::FindCategoryResolution(int category_id)
+{
+ auto it = m_category_resolution.find(category_id);
+ if (it == m_category_resolution.end()) {
+ RI_ERR("category(%d) not found", category_id);
+ return -1;
+ }
+ RI_INFO("category resolution(%d:%d)", category_id, it->second);
+ return it->second;
+}
+// LCOV_EXCL_END
+
+void CResourceInfoDB::AddCategoryFramerate(ri_rsc_category_e category_id, int framerate)
+{
+ m_category_framerate.insert(std::pair<int, int>(category_id, framerate));
+}
+
+// LCOV_EXCL_START
+int CResourceInfoDB::FindCategoryFramerate(int category_id)
+{
+ auto it = m_category_framerate.find(category_id);
+ if (it == m_category_framerate.end()) {
+ RI_ERR("category(%d) not found", category_id);
+ return -1;
+ }
+ RI_INFO("category framerate(%d:%d)", category_id, it->second);
+ return it->second;
+}
+// LCOV_EXCL_END
+
+void CResourceInfoDB::AddVideoCodec(std::string name, int resolution, int framerate)
+{
+ CVideoCodec *vcodec;
+
+ if (name.empty())
+ return;
+
+ auto it = m_video_codecs.find(name);
+ if (it == m_video_codecs.end()) {
+ vcodec = new CVideoCodec(name, resolution, framerate, IsCodecSupporting2KPortrait(name));
+ m_video_codecs.insert(std::pair<std::string, CVideoCodec*>(name, vcodec));
+ } else {
+ vcodec = it->second;
+ if (resolution > vcodec->GetMaxResolution()) {
+ vcodec->SetMaxResolution(resolution);
+ vcodec->SetMaxFrameRate(framerate);
+ } else if (framerate > vcodec->GetMaxFrameRate()) {
+ vcodec->SetMaxFrameRate(framerate);
+ }
+ }
+
+ if (resolution == RI_RESOLUTION_QuadHD || resolution == RI_RESOLUTION_DQHD || resolution == RI_RESOLUTION_5K)
+ vcodec->CreateExtraResolution(resolution);
+}
+
+// LCOV_EXCL_START
+ri_rsc_category_e CResourceInfoDB::GetAudioDecoderCategoryId(const char *codec_name)
+{
+ auto it = m_supported_audio_codecs.find(std::string(codec_name));
+ return (it == m_supported_audio_codecs.end()) ? RI_CATEGORY_AUDIO_DECODER_NOT_SUPPORTED : it->second;
+}
+
+int CResourceInfoDB::GetCategoryClass(int category_id)
+{
+ auto it = m_resource_categories.find(category_id);
+
+ return (it == m_resource_categories.end()) ? 0 : it->second->class_id;;
+}
+// LCOV_EXCL_END
+
+void CResourceInfoDB::AddCategoryInfo(ri_resource_category_s* category)
+{
+ assert(category);
+ m_resource_categories.insert(std::pair<int, ri_resource_category_s*>(category->id, category));
+}
+
+void CResourceInfoDB::AddDeviceAttributes(ri_device_common_attr_s* device_attr)
+{
+ assert(device_attr);
+
+ if (IsScaler(device_attr->category)) {
+ m_scalers.insert(std::pair<int, ri_device_common_attr_s*>(device_attr->id, device_attr));
+ m_n_scalers = m_scalers.size();
+ }
+
+ m_device_attr_map_by_dev_id.insert(std::pair<int, ri_device_common_attr_s*>(device_attr->id, device_attr));
+}
+
+void CResourceInfoDB::AddDeviceUniqueAttributes(IN const int id_unique, IN ri_device_unique_attr_s* device_attr)
+{
+ m_device_unique_attr.insert(std::pair<int, ri_device_unique_attr_s*>(id_unique, device_attr));
+}
+
+bool CResourceInfoDB::HasDeviceUniqueAttributes(const int id_unique)
+{
+ auto it = m_device_unique_attr.find(id_unique);
+ return (it == m_device_unique_attr.end()) ? false:true;
+}
+
+ri_return_code_e CResourceInfoDB::GetCategoryType(int device_id, int* category_type)
+{
+ std::map<int, ri_device_unique_attr_s*>::iterator iter = m_device_unique_attr.find(device_id);
+
+ if (iter == m_device_unique_attr.end()) {
+ if (IsVirtualDeviceIdScaler(device_id)) {
+ RI_INFO("DevID[%d]/CatID[%d] Get Category type", device_id, RI_CATEGORY_SCALER);
+ *category_type = RI_CATEGORY_SCALER;
+ return RI_OK;
+ }
+
+ RI_ERR("DevID[%d] Cannot find category type", device_id);
+ return RI_ERROR;
+ }
+
+ RI_INFO("DevID[%d:%s]/CatID[%d] Get Category type", iter->first, iter->second->name, iter->second->category);
+
+ *category_type = iter->second->category;
+
+ return RI_OK;
+}
+
+// LCOV_EXCL_START
+int CResourceInfoDB::GetMainCategory(IN int device_id)
+{
+ auto it = m_device_unique_attr.find(device_id);
+ if (it == m_device_unique_attr.end()) {
+ RI_ERR("can't find main category(%d)", device_id);
+ return 0;
+ }
+
+ return it->second->category;
+}
+
+std::string CResourceInfoDB::GetDeviceNodePathScaler(const int device_id)
+{
+ auto it = m_scalers.begin();
+ return (it == m_scalers.end()) ? std::string("") : std::string(it->second->path);
+}
+
+std::string CResourceInfoDB::GetDeviceNameScaler(const int device_id)
+{
+ auto it = m_scalers.begin();
+ return (it == m_scalers.end()) ? std::string("") : std::string(it->second->name);
+}
+
+ri_return_code_e CResourceInfoDB::GetDeviceNodePath(const int device_id, char** device_path)
+{
+ std::map<int, ri_device_unique_attr_s*>::iterator iter = m_device_unique_attr.find(device_id);
+ std::string path;
+
+ if (iter == m_device_unique_attr.end()) {
+ if (IsVirtualDeviceIdScaler(device_id)) {
+ path = GetDeviceNodePathScaler(device_id);
+ *device_path = strdup(path.c_str());
+ RI_INFO("DEVICE ID : %d, DEVICE PATH : %s", device_id, *device_path);
+ return RI_OK;
+ }
+ RI_INFO("DEVICE ID : %d CANNOT GET PATH", device_id);
+ return RI_ERROR;
+ }
+
+ if (device_id == RI_DEVICE_UNDEFINED)
+ return RI_ERROR;
+
+ *device_path = strdup(iter->second->path);
+
+ RI_INFO("DEVICE ID : %d, DEVICE PATH : %s", device_id, *device_path);
+
+ return RI_OK;
+}
+
+const char *CResourceInfoDB::GetDeviceName(const int device_id)
+{
+ std::map<int, ri_device_unique_attr_s*>::iterator iter = m_device_unique_attr.find(device_id);
+ std::string name;
+ if (iter == m_device_unique_attr.end()) {
+ if (IsVirtualDeviceIdScaler(device_id)) {
+ name = GetDeviceNameScaler(device_id);
+ RI_INFO("DEVICE ID : %d, DEVICE NAME : %s", device_id, name.c_str());
+ return strdup(name.c_str());
+ }
+
+ RI_INFO("[NULL] DEVICE ID : %d CANNOT GET NAME", device_id);
+ return NULL;
+ }
+
+ if (device_id == RI_DEVICE_UNDEFINED) {
+ RI_INFO("[NULL] DEVICE ID : %d RI_DEVICE_UNDEFINED", device_id);
+ return NULL;
+ }
+
+ RI_INFO("DEVICE ID : %d, DEVICE NAME : %s", device_id, iter->second->name);
+
+ return iter->second->name;
+}
+
+bool CResourceInfoDB::IsMainDevice(const int device_id)
+{
+ auto it = m_device_unique_attr.find(device_id);
+ if (it == m_device_unique_attr.end()) {
+ RI_ERR("invalid device id (%d)", device_id);
+ return false;
+ }
+ return it->second->main_device;
+}
+
+ri_return_code_e CResourceInfoDB::GetOmxCompName(const int device_id, char** name)
+{
+ std::map<int, ri_device_unique_attr_s*>::iterator iter = m_device_unique_attr.find(device_id);
+
+ if (iter == m_device_unique_attr.end()) {
+ if (IsVirtualDeviceIdScaler(device_id)) {
+ *name = strdup("");
+ RI_INFO("DEVICE ID : %d, OMX COMPONENT NAME : %s", device_id, *name);
+ return RI_OK;
+ }
+ return RI_ERROR;
+ }
+
+ if (device_id == RI_DEVICE_UNDEFINED)
+ return RI_ERROR;
+
+ *name = strdup(iter->second->omx_comp_name);
+
+ RI_INFO("DEVICE ID : %d, OMX COMPONENT NAME : %s", device_id, *name);
+
+ return RI_OK;
+}
+
+ri_return_code_e CResourceInfoDB::GetDeviceList(OUT int* num, OUT ri_device_common_attr_s** devices)
+{
+ if (m_device_attr_map_by_dev_id.empty()) {
+ if (ParseXMLFile(this) < 0) {
+ RI_ERR("COULD NOT GET DEVICE INFO");
+ return RI_ERROR;
+ }
+
+ InitVideoDecCategories();
+ }
+
+ *num = m_device_attr_map_by_dev_id.size();
+ *devices = (ri_device_common_attr_s*) malloc (sizeof(ri_device_common_attr_s) * (*num));
+ assert(*devices);
+
+ unsigned int cnt = 0;
+
+ for (auto const &it : m_device_attr_map_by_dev_id) {
+ (*devices)[cnt].id = it.second->id;
+ (*devices)[cnt].category = it.second->category;
+ (*devices)[cnt].name = it.second->name;
+ (*devices)[cnt].path = it.second->path;
+ (*devices)[cnt].bw = it.second->bw;
+
+ (*devices)[cnt].n_mem_clusters = it.second->n_mem_clusters;
+ for (unsigned int i = 0; i < it.second->n_mem_clusters; i++)
+ (*devices)[cnt].mem_clusters[i] = it.second->mem_clusters[i];
+
+ (*devices)[cnt].sharable_count = it.second->sharable_count;
+ (*devices)[cnt].mixing_count = it.second->mixing_count;
+ (*devices)[cnt].is_uhd_device = it.second->is_uhd_device;
+ (*devices)[cnt].id_unique = it.second->id_unique;
+ (*devices)[cnt].is_main_device = it.second->is_main_device;
+ (*devices)[cnt].audio_codec = it.second->audio_codec;
+
+ int main_category = GetMainCategory(it.second->id_unique);
+ (*devices)[cnt].category_main = (main_category != 0) ? main_category:it.second->category;
+
+ cnt++;
+ }
+
+ return RI_OK;
+}
+
+
+int CResourceInfoDB::GetDeviceID(unsigned int category, unsigned int device_sz, int* device_id)
+{
+ if (device_id == NULL) {
+ RI_ERR("INVALID INPUT");
+ return RI_ERROR;
+ }
+
+ unsigned int cnt = 0;
+
+ for (std::map<int, ri_device_common_attr_s*>::iterator iter = m_device_attr_map_by_dev_id.begin(); iter != m_device_attr_map_by_dev_id.end(); iter++) {
+ if (iter->second->category == category) {
+ device_id[cnt] = iter->second->id;
+ cnt++;
+
+ if (cnt >= device_sz) {
+ //RI_ERR("INVALID NUMBER");
+ break;
+ }
+ }
+ }
+
+ if (cnt == 0) {
+ RI_ERR("no device according to category(%d)", category);
+ return RI_ERROR;
+ }
+
+ return RI_OK;
+}
+
+ri_device_common_attr_s* CResourceInfoDB::GetDeviceAttr(int device_id)
+{
+ auto it = m_device_attr_map_by_dev_id.find(device_id);
+
+ if (it == m_device_attr_map_by_dev_id.end()) {
+ RI_ERR("cannot find device_attr according to device_id(%d)", device_id);
+ return NULL;
+ }
+
+ return it->second;
+}
+// LCOV_EXCL_STOP
+
+bool CResourceInfoDB::GetDeviceNodePathNames(int category, char** device_node)
+{
+ for (std::map<int, ri_device_common_attr_s*>::iterator iter = m_device_attr_map_by_dev_id.begin(); iter != m_device_attr_map_by_dev_id.end(); iter++) {
+ if (iter->second->category == (unsigned int)category) {
+ *device_node = strndup(iter->second->path, strlen(iter->second->path));
+ return true;
+ }
+ }
+ RI_INFO("cat[%d] has no device", category);
+ return false;
+}
+
+bool CResourceInfoDB::GetClassOptions(const char *codec, ri_video_decoder_class_e class_value, bool* is_uhd_decoder, int* class_cat, bool* is_class_uhd, char** class_device_node)
+{
+ int low_class = 99999;
+ int high_class = 0; //uhd
+ bool is_exist = false;
+ char *tmp_device_node = NULL;
+ std::string codec_name;
+
+ for (auto &iter : m_resource_categories) {
+ ri_resource_category_s* category = iter.second;
+
+ if (!category)
+ continue;
+ if ((category->class_id == 0) || (category->class_id >= 100))
+ continue;
+
+ codec_name.assign(category->codec);
+ if (!codec_name.compare(codec) && GetDeviceNodePathNames(category->id, &tmp_device_node)) {
+ if (class_value == RI_VIDEO_CATEGORY_CLASS_LOW) {
+ if (low_class > category->class_id) {
+ low_class = category->class_id;
+ *is_class_uhd = category->is_uhd_device;
+ *class_cat = category->id;
+
+ if (*class_device_node)
+ free(*class_device_node);
+ *class_device_node = strndup(tmp_device_node, strlen(tmp_device_node));
+ }
+ } else if (class_value == RI_VIDEO_CATEGORY_CLASS_HIGH) {
+ if (high_class < category->class_id) {
+ high_class = category->class_id;
+ *is_class_uhd = category->is_uhd_device;
+ *class_cat = category->id;
+
+ if (*class_device_node)
+ free(*class_device_node);
+ *class_device_node = strndup(tmp_device_node, strlen(tmp_device_node));
+ }
+ }
+ RI_INFO("found it!! CODEC[%s] category[%d/%s] %s", category->codec, category->id, category->name, (*is_uhd_decoder == true) ? "UHDdecoder" : "");
+ is_exist = true;
+ }
+
+ if (tmp_device_node) {
+ free(tmp_device_node);
+ tmp_device_node = NULL;
+ }
+ }
+
+ return is_exist;
+}
+ri_return_code_e CResourceInfoDB::GetCategoryOption(const char *codec, ri_video_decoder_class_e class_value, int *category_option, bool *is_uhd_decoder, char **device_node)
+{
+ bool is_class_uhd = false;
+ int class_cat = 0;
+ char *class_device_node = NULL;
+
+ *category_option = RI_CATEGORY_VIDEO_DECODER_NOT_SUPPORTED;
+ *is_uhd_decoder = false;
+ *device_node = NULL;
+
+ if (!GetClassOptions(codec, class_value, is_uhd_decoder, &class_cat, &is_class_uhd, &class_device_node)) {
+ RI_ERR("No resource category corresponding with requested info (codec:%s)", codec);
+ return RI_ERROR;
+ }
+
+ if (!class_device_node)
+ return RI_ERROR;
+
+ *category_option = class_cat;
+ *is_uhd_decoder = is_class_uhd;
+ *device_node = strndup(class_device_node, strlen(class_device_node));
+
+ RI_INFO("%s class request. ret option[%d]. is_uhd[%s]. node[%s]", (class_value ? "High" : "Low"),*category_option, (*is_uhd_decoder == true) ?"true":"false", *device_node);
+
+ free(class_device_node);
+ return RI_OK;
+}
+
+// LCOV_EXCL_START
+unsigned int CResourceInfoDB::GetDeviceID(char *node)
+{
+ unsigned int id = 0;
+ std::string path;
+
+ for (std::map<int, ri_device_common_attr_s*>::iterator iter = m_device_attr_map_by_dev_id.begin(); iter != m_device_attr_map_by_dev_id.end(); iter++) {
+ path.assign(iter->second->path);
+ if (!path.compare(node))
+ id = (int)(iter->second->id_unique);
+ }
+
+ RI_INFO("device node[%s] - device id[%d]", node, id);
+ return id;
+}
+// LCOV_EXCL_STOP
+
+ri_return_code_e CResourceInfoDB::GetDefaultDeviceNodePath(ri_rsc_category_e category, char** node)
+{
+ for (std::map<int, ri_device_common_attr_s*>::iterator iter = m_device_attr_map_by_dev_id.begin(); iter != m_device_attr_map_by_dev_id.end(); iter++) {
+ if (iter->second->category == (unsigned int)category) {
+ *node = strndup(iter->second->path, strlen(iter->second->path));
+ RI_INFO("category[%d] node[%s]", (unsigned int)category, *node);
+
+ return RI_OK;
+ }
+ }
+
+ return RI_ERROR;
+}
+
+// LCOV_EXCL_START
+
+void CResourceInfoDB::PrintDeviceUniqueInfo(void)
+{
+ for (std::map<int, ri_device_unique_attr_s*>::iterator iter = m_device_unique_attr.begin(); iter != m_device_unique_attr.end(); iter++) {
+ RI_DBG("DevID[%d:%s]/CatID[%d]", iter->first, iter->second->name, iter->second->category);
+ }
+}
+// LCOV_EXCL_STOP
+
+// LCOV_EXCL_START
+bool CResourceInfoDB::IsVideoDecoderCategory(ri_rsc_category_e vdec)
+{
+ if (vdec > RI_CATEGORY_VIDEO_DECODER_OPTION && vdec < RI_VIDEO_CATEGORY_MAX)
+ return true;
+ if (vdec == RI_CATEGORY_VIDEO_DECODER || vdec == RI_CATEGORY_VIDEO_DECODER_SUB)
+ return true;
+
+ return false;
+}
+
+bool CResourceInfoDB::IsAudioDecoderCategory(ri_rsc_category_e adec)
+{
+ if (adec > RI_CATEGORY_AUDIO_DECODER_OPTION && adec < RI_AUDIO_CATEGORY_MAX)
+ return true;
+ if (adec == RI_CATEGORY_AUDIO_DECODER || adec == RI_CATEGORY_AUDIO_DECODER_SUB)
+ return true;
+
+ return false;
+}
+
+bool CResourceInfoDB::IsAudioDecoderCategoryForMixing(ri_rsc_category_e adec)
+{
+ return (adec > RI_CATEGORY_AUDIO_DECODER_OPTION && adec < RI_AUDIO_CATEGORY_MAX) ? true:false;
+}
+
+bool CResourceInfoDB::IsMJpegDecoderCategory(ri_rsc_category_e category)
+{
+ if (category > RI_CATEGORY_MJPEG_DECODER_OPTION && category <= RI_CATEGORY_MJPEG_DECODER_8K)
+ return true;
+ if (category == RI_CATEGORY_MJPEG_DECODER)
+ return true;
+
+ return false;
+}
+
+int CResourceInfoDB::GetAIDecoderCategoryId(ri_rsc_category_e vdec)
+{
+ // This feature is deprecated since Tizen6.5 because there is no chipset requiring upscaling
+ RI_INFO("vdec : (%d)", vdec);
+ return vdec;
+}
+// LCOV_EXCL_STOP
+
+CVideoCodec* CResourceInfoDB::FindVideoCodec(std::string name)
+{
+ auto it = m_video_codecs.find(name);
+ return (it == m_video_codecs.end()) ? NULL : it->second;
+}
+
+CVideoCodecNDecoding *CResourceInfoDB::FindNDecodingVideoCodec(std::string codec_name)
+{
+ auto it = m_n_decoding_codecs.find(codec_name);
+ return (it == m_n_decoding_codecs.end()) ? NULL : it->second;
+}
+
+// LCOV_EXCL_START
+bool CResourceInfoDB::IsVirtualDeviceIdScaler(int device_id)
+{
+ if (device_id < RI_VIRTUAL_ID_SCALER)
+ return false;
+
+ int id_max = (RI_VIRTUAL_ID_SCALER + m_n_scalers - 1);
+
+ return (device_id <= id_max);
+}
+
+bool CResourceInfoDB::IsScaler(int category)
+{
+ bool result = false;
+
+ switch(category) {
+ case RI_CATEGORY_SCALER:
+ case RI_CATEGORY_SCALER_SUB:
+ case RI_CATEGORY_SCALER_SUB2:
+ case RI_CATEGORY_SCALER_SUB3:
+ case RI_CATEGORY_SCALER_BG:
+ result = true;
+ break;
+ default:
+ break;
+ }
+
+ return result;
+}
+// LCOV_EXCL_STOP
+
+CCategoryIdBuilder* CResourceInfoDB::GetVideoDecCategoryBuilder(std::string codec_name)
+{
+ if (!codec_name.compare(std::string(RI_CODEC_NAME_MPEG1)))
+ return new CategoryIdBuilderMPEG1();
+
+ if (!codec_name.compare(std::string(RI_CODEC_NAME_MPEG2)))
+ return new CategoryIdBuilderMPEG2();
+
+ if (!codec_name.compare(std::string(RI_CODEC_NAME_MPEG4)))
+ return new CategoryIdBuilderMPEG4();
+
+ if (!codec_name.compare(std::string(RI_CODEC_NAME_H263)))
+ return new CCategoryIdBuilderH263();
+
+ if (!codec_name.compare(std::string(RI_CODEC_NAME_H264)))
+ return new CategoryIdBuilderH264();
+
+ if (!codec_name.compare(std::string(RI_CODEC_NAME_HEVC)))
+ return new CategoryIdBuilderHEVC();
+
+ if (!codec_name.compare(std::string(RI_CODEC_NAME_VP8)))
+ return new CategoryIdBuilderVP8();
+
+ if (!codec_name.compare(std::string(RI_CODEC_NAME_VP9)))
+ return new CategoryIdBuilderVP9();
+
+ if (!codec_name.compare(std::string(RI_CODEC_NAME_RV)))
+ return new CategoryIdBuilderRV();
+
+ if (!codec_name.compare(std::string(RI_CODEC_NAME_WMV)))
+ return new CategoryIdBuilderWMV();
+
+ if (!codec_name.compare(std::string(RI_CODEC_NAME_AVS)))
+ return new CategoryIdBuilderAVS();
+
+ if (!codec_name.compare(std::string(RI_CODEC_NAME_AVS_PLUS)))
+ return new CategoryIdBuilderAVSPlus();
+
+ if (!codec_name.compare(std::string(RI_CODEC_NAME_H264_MVC)))
+ return new CategoryIdBuilderH264MVC();
+
+ if (!codec_name.compare(std::string(RI_CODEC_NAME_HEVC_VR360)))
+ return new CategoryIdBuilderHEVCvr360();
+
+ if (!codec_name.compare(std::string(RI_CODEC_NAME_H264_VR360)))
+ return new CategoryIdBuilderH264vr360();
+
+ if (!codec_name.compare(std::string(RI_CODEC_NAME_VP9_VR360)))
+ return new CategoryIdBuilderVP9vr360();
+
+ if (!codec_name.compare(std::string(RI_CODEC_NAME_HEVC_SHVC)))
+ return new CategoryIdBuilderSHVC();
+
+ if (!codec_name.compare(std::string(RI_CODEC_NAME_AV1)))
+ return new CategoryIdBuilderAV1();
+
+ if (!codec_name.compare(std::string(RI_CODEC_NAME_AV1_VR360)))
+ return new CategoryIdBuilderAV1vr360();
+
+ if (!codec_name.compare(std::string(RI_CODEC_NAME_AVS2)))
+ return new CategoryIdBuilderAVS2();
+
+ if (!codec_name.compare(std::string(RI_CODEC_NAME_VVC)))
+ return new CategoryIdBuilderVVC();
+
+ if (!codec_name.compare(std::string(RI_CODEC_NAME_AVS3)))
+ return new CategoryIdBuilderAVS3();
+
+ RI_ERR("unexpected codec (%s)", codec_name.c_str());
+ return nullptr;
+}
+
+struct video_2K_portrait_rsz_support{
+ const char *codec_name;
+ bool support;
+};
+
+bool CResourceInfoDB::IsCodecSupporting2KPortrait(std::string codec_name)
+{
+ video_2K_portrait_rsz_support video_codecs[] = {
+ {RI_CODEC_NAME_MPEG1, false},
+ {RI_CODEC_NAME_MPEG2, false},
+ {RI_CODEC_NAME_MPEG4, false},
+ {RI_CODEC_NAME_H263, false},
+ {RI_CODEC_NAME_H264, true},
+ {RI_CODEC_NAME_HEVC, true},
+ {RI_CODEC_NAME_VP8, false},
+ {RI_CODEC_NAME_VP9, true},
+ {RI_CODEC_NAME_RV, false},
+ {RI_CODEC_NAME_WMV, false},
+ {RI_CODEC_NAME_AVS, false},
+ {RI_CODEC_NAME_AVS_PLUS, false},
+ {RI_CODEC_NAME_H264_MVC, true},
+ {RI_CODEC_NAME_HEVC_VR360, true},
+ {RI_CODEC_NAME_H264_VR360, true},
+ {RI_CODEC_NAME_VP9_VR360, true},
+ {RI_CODEC_NAME_HEVC_SHVC, true},
+ {RI_CODEC_NAME_AV1, true},
+ {RI_CODEC_NAME_AV1_VR360, true},
+ {RI_CODEC_NAME_AVS2, true},
+ {RI_CODEC_NAME_AVS3, true},
+ {RI_CODEC_NAME_VVC, true}
+ };
+
+ for (unsigned int i = 0; i < ARRAY_SIZE(video_codecs); i++) {
+ if (!codec_name.compare(video_codecs[i].codec_name))
+ return video_codecs[i].support;
+ }
+
+ RI_ERR("undefined video codec(%s)", codec_name.c_str());
+ return false;
+}
+
+bool CResourceInfoDB::Support2KPortraitResolution(std::string codec_name)
+{
+ CVideoCodec* codec = FindVideoCodec(codec_name);
+
+ return (!codec) ? false:codec->Support2KPortraitResolution();
+}
+
+void CResourceInfoDB::InitVideoDecCategories(void)
+{
+ const char *video_codecs[] = {
+ RI_CODEC_NAME_MPEG1,
+ RI_CODEC_NAME_MPEG2,
+ RI_CODEC_NAME_MPEG4,
+ RI_CODEC_NAME_H263,
+ RI_CODEC_NAME_H264,
+ RI_CODEC_NAME_HEVC,
+ RI_CODEC_NAME_VP8,
+ RI_CODEC_NAME_VP9,
+ RI_CODEC_NAME_RV,
+ RI_CODEC_NAME_WMV,
+ RI_CODEC_NAME_AVS,
+ RI_CODEC_NAME_AVS_PLUS,
+ RI_CODEC_NAME_H264_MVC,
+ RI_CODEC_NAME_HEVC_VR360,
+ RI_CODEC_NAME_H264_VR360,
+ RI_CODEC_NAME_VP9_VR360,
+ RI_CODEC_NAME_HEVC_SHVC,
+ RI_CODEC_NAME_AV1,
+ RI_CODEC_NAME_AV1_VR360,
+ RI_CODEC_NAME_AVS2,
+ RI_CODEC_NAME_AVS3,
+ RI_CODEC_NAME_VVC
+ };
+
+ std::string codec_name;
+ CVideoDecoderCategory* vdec_category;
+
+ for (unsigned int i = 0; i < ARRAY_SIZE(video_codecs); i++) {
+ codec_name.assign(video_codecs[i]);
+ vdec_category = new CVideoDecoderCategory(codec_name, GetVideoDecCategoryBuilder(codec_name));
+ vdec_category->CreateCategoryIds();
+ m_video_dec_categories.insert(std::pair<std::string, CVideoDecoderCategory*>(codec_name, vdec_category));
+ }
+
+}
+
+int CResourceInfoDB::GetVideoDecCategoryId(std::string codec_name, int rsz_id, int framerate, int color_depth)
+{
+ auto it = m_video_dec_categories.find(codec_name);
+
+ //RI_INFO("size(%d) - codec name (%s)/rsz_id(%d)/framerate(%d)/color_depth(%d)", m_video_dec_categories.size(), codec_name.c_str(), rsz_id, framerate, color_depth);
+
+ if (it == m_video_dec_categories.end()) {
+ RI_ERR("codec not found (%s)", codec_name.c_str());
+ return RI_CATEGORY_VIDEO_DECODER_NOT_SUPPORTED;
+ }
+
+ return it->second->FindVideoCategoryId(rsz_id, framerate, color_depth);
+}
+
+void CResourceInfoDB::SetImageMinMaxResolution(std::string codec, int w_min, int h_min, int w_max, int h_max)
+{
+ CImageCodec *img = NULL;
+ auto it = m_image_codecs.find(codec);
+
+ if (it == m_image_codecs.end()) {
+ img = new CImageCodec(codec);
+ m_image_codecs.insert(std::pair<std::string, CImageCodec*>(codec, img));
+ } else {
+ img = it->second;
+ }
+
+ img->SetMaxResolution(w_max, h_max);
+ img->SetMinResolution(w_min, h_min);
+}
+
+void CResourceInfoDB::GetImageMinMaxResolution(std::string codec, int *w_min, int *h_min, int *w_max, int *h_max)
+{
+ auto it = m_image_codecs.find(codec);
+ if (it == m_image_codecs.end()) {
+ RI_ERR("not supported codec(%s)", codec.c_str());
+ *w_min = 0;
+ *h_min = 0;
+ *w_max = 0;
+ *h_max = 0;
+ return;
+ }
+
+ CImageCodec *img = it->second;
+ img->GetMaxResolution(w_max, h_max);
+ img->GetMinResolution(w_min, h_min);
+}
+
+// LCOV_EXCL_START
+bool CResourceInfoDB::IsSupportOverlay(const int device_id)
+{
+ auto it = m_device_unique_attr.find(device_id);
+ return (it == m_device_unique_attr.end()) ? false : it->second->support_overlay;
+}
+
+int CResourceInfoDB::GetMaxResolution(const int device_id)
+{
+ auto it = m_device_unique_attr.find(device_id);
+ return (it == m_device_unique_attr.end()) ? 0 : it->second->max_rez;
+}
+
+int CResourceInfoDB::GetMaxSamplingFormat(const int device_id)
+{
+ auto it = m_device_unique_attr.find(device_id);
+ return (it == m_device_unique_attr.end()) ? 0 : it->second->max_sampling_format;
+}
+
+int CResourceInfoDB::ToNDecodingCategory(int category)
+{
+ if (category == RI_CATEGORY_VIDEO_DECODER_H264_FHD_8BIT_30P)
+ return RI_CATEGORY_VIDEO_DECODER_H264_FHD_N_8BIT_30P;
+
+ return category;
+}
+
+int CResourceInfoDB::Set2KSize(std::string codec_name, int w, int h, int wp, int hp)
+{
+ CVideoCodec* codec = FindVideoCodec(codec_name);
+ if (!codec) {
+ RI_ERR("codec(%s) not found", codec_name.c_str());
+ return -1;
+ }
+
+ codec->SetResolutionSize(RI_RESOLUTION_FHD, w, h, wp, hp);
+ return 0;
+}
+
+int CResourceInfoDB::Set4KSize(std::string codec_name, int w, int h, int wp, int hp)
+{
+ CVideoCodec* codec = FindVideoCodec(codec_name);
+ if (!codec) {
+ RI_ERR("codec(%s) not found", codec_name.c_str());
+ return -1;
+ }
+
+ codec->SetResolutionSize(RI_RESOLUTION_4K_UHD, w, h, wp, hp);
+ return 0;
+}
+
+int CResourceInfoDB::Set8KSize(std::string codec_name, int w, int h, int wp, int hp)
+{
+ CVideoCodec* codec = FindVideoCodec(codec_name);
+ if (!codec) {
+ RI_ERR("codec(%s) not found", codec_name.c_str());
+ return -1;
+ }
+
+ codec->SetResolutionSize(RI_RESOLUTION_8K_UHD, w, h, wp, hp);
+ return 0;
+}
+// LCOV_EXCL_STOP
+
+void CResourceInfoDB::AddVideoDecoder(int id, std::string codec_name, int rsz, int framerate)
+{
+ const auto &it = m_video_decoders.find(id);
+ if (it != m_video_decoders.end()) {
+ it->second->InsertVideoCodec(codec_name, rsz, framerate);
+ return;
+ }
+
+ CVideoDecoder *vdec = new CVideoDecoder(id);
+ vdec->InsertVideoCodec(codec_name, rsz, framerate);
+ m_video_decoders.insert(std::pair<int, CVideoDecoder *>(id, vdec));
+}
+
+// LCOV_EXCL_START
+int CResourceInfoDB::GetVideoDecoderList(ri_resource_list_h *list_out)
+{
+ if (!list_out)
+ return -1;
+
+ ri_resource_list* vdec_list = (ri_resource_list*) calloc(1, sizeof(ri_resource_list));
+ assert(vdec_list);
+
+ for (const auto &it_vdec : m_video_decoders) {
+ ri_video_decoder* vdec = (ri_video_decoder*) calloc(1, sizeof(ri_video_decoder));
+ assert(vdec);
+ vdec->id = it_vdec.second->GetId();
+ RI_INFO("vdec->id : %d", vdec->id);
+
+ std::map<std::string, CVideoCodec*> codecs = it_vdec.second->GetSupportedCodecs();
+
+ for (const auto &it_codec : codecs) {
+ ri_vcodec* vcodec = (ri_vcodec*) calloc(1, sizeof(ri_vcodec));
+ assert(vcodec);
+ vcodec->codec_name = strndup(it_codec.second->GetName().c_str(), it_codec.second->GetName().length());
+ vcodec->rsz_id = it_codec.second->GetMaxResolution();
+ vcodec->framerate = it_codec.second->GetMaxFrameRate();
+ RI_INFO("vcodec name : %s, rsz_id : %d, framerate : %d", vcodec->codec_name, vcodec->rsz_id, vcodec->framerate);
+ vdec->codec_list = g_list_append(vdec->codec_list, vcodec);
+ }
+ vdec->n_codecs = g_list_length(vdec->codec_list);
+ RI_INFO("vdec->n_codecs : %d", vdec->n_codecs);
+ vdec->iter = vdec->codec_list;
+
+ vdec_list->rsc_list = g_list_append(vdec_list->rsc_list, vdec);
+ }
+
+ vdec_list->n_rsc = g_list_length(vdec_list->rsc_list);
+ vdec_list->iter = vdec_list->rsc_list;
+ *list_out = vdec_list;
+
+ return 0;
+}
+
+std::string CResourceInfoDB::FindCategoryVideoCodecName(int category_id)
+{
+ std::string codec_name("");
+
+ auto it = m_resource_categories.find(category_id);
+ if (it == m_resource_categories.end()) {
+ RI_ERR("category not found(%d)", category_id);
+ return codec_name;
+ }
+
+ ri_resource_category_s* cat = it->second;
+ codec_name.assign(cat->codec);
+
+ RI_INFO("category codec name (%d:%s)", category_id, codec_name.c_str());
+ return codec_name;
+}
+// LCOV_EXCL_END
+
+int CResourceInfoDB::GetNumOfDeviceBelongsTo(int category_id)
+{
+ auto it = m_resource_categories.find(category_id);
+ if (it == m_resource_categories.end()) {
+ RI_ERR("category not found(%d)", category_id);
+ return 0;
+ }
+
+ ri_resource_category_s* category = it->second;
+ RI_INFO("number of devices belongs to (%d) : (%d)", category_id, category->num_of_dev);
+ return category->num_of_dev;
+}
+
+bool CResourceInfoDB::IsSupportedCategory(int category)
+{
+ auto it = m_resource_categories.find(category);
+ return (it != m_resource_categories.end());
+}
+
+void CResourceInfoDB::AddVideoCapability(const std::string codec, VideoCapability *capability)
+{
+ if (!capability) {
+ RI_ERR("invalid capability");
+ return;
+ }
+
+ RI_INFO("(%s:%s:%d:%d:%d)", codec.c_str(), capability->GetDeviceProperty().c_str(), capability->GetWidth(), capability->GetHeight(), capability->GetFPS());
+
+ auto it = video_capabilities_.find(codec);
+ if (it == video_capabilities_.end()) {
+ std::vector<VideoCapability*> capabilities;
+ capabilities.push_back(capability);
+ video_capabilities_[codec] = capabilities;
+ return;
+ }
+
+ it->second.push_back(capability);
+}
+
+bool CResourceInfoDB::FindVideoCapability(const std::string codec, std::vector<VideoCapability*> &capabilities)
+{
+ auto it = video_capabilities_.find(codec);
+ if (it == video_capabilities_.end()) {
+ RI_INFO("not found (%s)", codec.c_str());
+ return false;
+ }
+
+ for (auto itc : it->second)
+ capabilities.push_back(new VideoCapability(*itc));
+
+ RI_INFO("found (%s:%zu)", codec.c_str(), capabilities.size());
+ return true;
+}
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#include <ri-debug.h>\r
-#include <CVideoCodec.h>\r
-\r
-CVideoCodec::CVideoCodec(const std::string name, const unsigned int resolution, const int fps, const bool support_2k_portrait):\\r
- name_(name), max_resolution_(resolution), max_fps_(fps), support_2k_portrait_(support_2k_portrait), vr360_codec_(false)\r
-{\r
- InitResolutions();\r
- auto it = vr360_codecs_.find(name);\r
- if (it != vr360_codecs_.end())\r
- vr360_codec_ = true;\r
-}\r
-\r
-void CVideoCodec::InitResolutions(void)\r
-{\r
- unsigned int default_resolutions[] = {\r
- RI_RESOLUTION_qHD,\r
- RI_RESOLUTION_HD,\r
- RI_RESOLUTION_FHD,\r
- RI_RESOLUTION_4K_UHD,\r
- RI_RESOLUTION_8K_UHD\r
- };\r
-\r
- for (unsigned int i = 0; i < ARRAY_SIZE(default_resolutions); i++)\r
- resolutions_.insert(std::pair<unsigned int, std::shared_ptr<CVideoResolution>>(default_resolutions[i], std::make_shared<CVideoResolution>(default_resolutions[i])));\r
-}\r
-\r
-// LCOV_EXCL_START\r
-void CVideoCodec::CreateExtraResolution(const unsigned int resolution)\r
-{\r
- auto it = resolutions_.find(resolution);\r
- if (it != resolutions_.end())\r
- return;\r
-\r
- RI_INFO("create resolution (%u)", resolution);\r
- resolutions_.insert(std::pair<unsigned int, std::shared_ptr<CVideoResolution>>(resolution, std::make_shared<CVideoResolution>(resolution)));\r
-}\r
-\r
-void CVideoCodec::SetResolutionSize(const unsigned int resolution, const int w, const int h, const int wp, const int hp)\r
-{\r
- auto it = resolutions_.find(resolution);\r
- if (it == resolutions_.end()) {\r
- RI_ERR("resolution (%u) not found", resolution);\r
- return;\r
- }\r
-\r
- it->second->SetSize(w, h, wp, hp);\r
- RI_INFO("codec(%s:%u) - %s", name_.c_str(), resolution, it->second->GetSizeString().c_str());\r
-}\r
-// LCOV_EXCL_END\r
-\r
-ri_resolution CVideoCodec::GetResolutionID(const int w, const int h) const\r
-{\r
- ri_resolution resolutions[] = {\r
- RI_RESOLUTION_qHD,\r
- RI_RESOLUTION_HD,\r
- RI_RESOLUTION_FHD,\r
- RI_RESOLUTION_QuadHD,\r
- RI_RESOLUTION_4K_UHD,\r
- RI_RESOLUTION_DQHD,\r
- RI_RESOLUTION_5K,\r
- RI_RESOLUTION_8K_UHD\r
- };\r
-\r
- for (unsigned int i = 0; i < ARRAY_SIZE(resolutions); i++) {\r
- std::shared_ptr<CVideoResolution> resolution = FindResolution(resolutions[i]);\r
- if (resolution == nullptr)\r
- continue;\r
-\r
- if (vr360_codec_) {\r
- if (resolution->SupportedSizeVR360(w, h))\r
- return resolutions[i];\r
- } else {\r
- if (resolution->SupportedSize(w, h))\r
- return resolutions[i];\r
- }\r
- }\r
-\r
- RI_ERR("unexpected size (%s : %d * %d)", name_.c_str(), w, h);\r
- return RI_RESOLUTION_UNDEFINED;\r
-}\r
-\r
-std::shared_ptr<CVideoResolution> CVideoCodec::FindResolution(const unsigned int resolution) const\r
-{\r
- auto it = resolutions_.find(resolution);\r
- if (it == resolutions_.end()) {\r
- RI_ERR("resolution (%u) not found", resolution);\r
- return nullptr;\r
- }\r
-\r
- return it->second;\r
-}\r
-\r
-bool CVideoCodec::IsSizeNotSupportedByFHDDecoder(const int resolution, const int w, const int h) const\r
-{\r
- auto it = resolutions_.find(resolution);\r
- if (it == resolutions_.end()) {\r
- RI_ERR("resolution (%u) not found", resolution);\r
- return false;\r
- }\r
-\r
- return it->second->SupportedSizeByFHDDecoder(w, h) ? false:true;\r
-}\r
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include <ri-debug.h>
+#include <CVideoCodec.h>
+
+CVideoCodec::CVideoCodec(const std::string name, const unsigned int resolution, const int fps, const bool support_2k_portrait):\
+ name_(name), max_resolution_(resolution), max_fps_(fps), support_2k_portrait_(support_2k_portrait), vr360_codec_(false)
+{
+ InitResolutions();
+ auto it = vr360_codecs_.find(name);
+ if (it != vr360_codecs_.end())
+ vr360_codec_ = true;
+}
+
+void CVideoCodec::InitResolutions(void)
+{
+ unsigned int default_resolutions[] = {
+ RI_RESOLUTION_qHD,
+ RI_RESOLUTION_HD,
+ RI_RESOLUTION_FHD,
+ RI_RESOLUTION_4K_UHD,
+ RI_RESOLUTION_8K_UHD
+ };
+
+ for (unsigned int i = 0; i < ARRAY_SIZE(default_resolutions); i++)
+ resolutions_.insert(std::pair<unsigned int, std::shared_ptr<CVideoResolution>>(default_resolutions[i], std::make_shared<CVideoResolution>(default_resolutions[i])));
+}
+
+// LCOV_EXCL_START
+void CVideoCodec::CreateExtraResolution(const unsigned int resolution)
+{
+ auto it = resolutions_.find(resolution);
+ if (it != resolutions_.end())
+ return;
+
+ RI_INFO("create resolution (%u)", resolution);
+ resolutions_.insert(std::pair<unsigned int, std::shared_ptr<CVideoResolution>>(resolution, std::make_shared<CVideoResolution>(resolution)));
+}
+
+void CVideoCodec::SetResolutionSize(const unsigned int resolution, const int w, const int h, const int wp, const int hp)
+{
+ auto it = resolutions_.find(resolution);
+ if (it == resolutions_.end()) {
+ RI_ERR("resolution (%u) not found", resolution);
+ return;
+ }
+
+ it->second->SetSize(w, h, wp, hp);
+ RI_INFO("codec(%s:%u) - %s", name_.c_str(), resolution, it->second->GetSizeString().c_str());
+}
+// LCOV_EXCL_END
+
+ri_resolution CVideoCodec::GetResolutionID(const int w, const int h) const
+{
+ ri_resolution resolutions[] = {
+ RI_RESOLUTION_qHD,
+ RI_RESOLUTION_HD,
+ RI_RESOLUTION_FHD,
+ RI_RESOLUTION_QuadHD,
+ RI_RESOLUTION_4K_UHD,
+ RI_RESOLUTION_DQHD,
+ RI_RESOLUTION_5K,
+ RI_RESOLUTION_8K_UHD
+ };
+
+ for (unsigned int i = 0; i < ARRAY_SIZE(resolutions); i++) {
+ std::shared_ptr<CVideoResolution> resolution = FindResolution(resolutions[i]);
+ if (resolution == nullptr)
+ continue;
+
+ if (vr360_codec_) {
+ if (resolution->SupportedSizeVR360(w, h))
+ return resolutions[i];
+ } else {
+ if (resolution->SupportedSize(w, h))
+ return resolutions[i];
+ }
+ }
+
+ RI_ERR("unexpected size (%s : %d * %d)", name_.c_str(), w, h);
+ return RI_RESOLUTION_UNDEFINED;
+}
+
+std::shared_ptr<CVideoResolution> CVideoCodec::FindResolution(const unsigned int resolution) const
+{
+ auto it = resolutions_.find(resolution);
+ if (it == resolutions_.end()) {
+ RI_ERR("resolution (%u) not found", resolution);
+ return nullptr;
+ }
+
+ return it->second;
+}
+
+bool CVideoCodec::IsSizeNotSupportedByFHDDecoder(const int resolution, const int w, const int h) const
+{
+ auto it = resolutions_.find(resolution);
+ if (it == resolutions_.end()) {
+ RI_ERR("resolution (%u) not found", resolution);
+ return false;
+ }
+
+ return it->second->SupportedSizeByFHDDecoder(w, h) ? false:true;
+}
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#include <CVideoCodec.h>\r
-#include <CVideoDecoder.h>\r
-\r
-void CVideoDecoder::InsertVideoCodec(std::string name, int rsz, int framerate)\r
-{\r
- const auto &it = m_supported_codecs.find(name);\r
-\r
- if (it == m_supported_codecs.end()) {\r
- m_supported_codecs.insert(std::pair<std::string, CVideoCodec*>(name, new CVideoCodec(name, rsz, framerate, false)));\r
- return;\r
- }\r
-\r
- CVideoCodec *codec = it->second;\r
- if (rsz > codec->GetMaxResolution()) {\r
- codec->SetMaxResolution(rsz);\r
- codec->SetMaxFrameRate(framerate);\r
- } else if ((rsz == codec->GetMaxResolution()) && (framerate > codec->GetMaxFrameRate())) {\r
- codec->SetMaxFrameRate(framerate);\r
- }\r
-}\r
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include <CVideoCodec.h>
+#include <CVideoDecoder.h>
+
+void CVideoDecoder::InsertVideoCodec(std::string name, int rsz, int framerate)
+{
+ const auto &it = m_supported_codecs.find(name);
+
+ if (it == m_supported_codecs.end()) {
+ m_supported_codecs.insert(std::pair<std::string, CVideoCodec*>(name, new CVideoCodec(name, rsz, framerate, false)));
+ return;
+ }
+
+ CVideoCodec *codec = it->second;
+ if (rsz > codec->GetMaxResolution()) {
+ codec->SetMaxResolution(rsz);
+ codec->SetMaxFrameRate(framerate);
+ } else if ((rsz == codec->GetMaxResolution()) && (framerate > codec->GetMaxFrameRate())) {
+ codec->SetMaxFrameRate(framerate);
+ }
+}
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#include <CCategory.h>\r
-\r
-CCategory::CCategory(std::string name, ri_rsc_category_e id, category_type_e type, std::string codec_name, ri_resolution rsz, int framerate, bool n_decoding)\r
-:m_name(name), m_id(id), m_type(type), m_codec_name(codec_name), m_rsz(rsz), m_framerate(framerate), m_n_decoding(n_decoding)\r
-{\r
-}\r
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include <CCategory.h>
+
+CCategory::CCategory(std::string name, ri_rsc_category_e id, category_type_e type, std::string codec_name, ri_resolution rsz, int framerate, bool n_decoding)
+:m_name(name), m_id(id), m_type(type), m_codec_name(codec_name), m_rsz(rsz), m_framerate(framerate), m_n_decoding(n_decoding)
+{
+}
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#include <assert.h>\r
-#include <stdlib.h>\r
-\r
-#include <system_info.h>\r
-\r
-#include <ri-debug.h>\r
-#include <CModelInfo.h>\r
-#include <CResourceTableProvider.h>\r
-\r
-CResourceTableProvider::CResourceTableProvider()\r
-{\r
-}\r
-\r
-CResourceTableProvider::~CResourceTableProvider()\r
-{\r
-}\r
-\r
-std::string CResourceTableProvider::GetResourceTablePath(void)\r
-{\r
- return PATH_DEFAULT;\r
-}\r
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include <assert.h>
+#include <stdlib.h>
+
+#include <system_info.h>
+
+#include <ri-debug.h>
+#include <CModelInfo.h>
+#include <CResourceTableProvider.h>
+
+CResourceTableProvider::CResourceTableProvider()
+{
+}
+
+CResourceTableProvider::~CResourceTableProvider()
+{
+}
+
+std::string CResourceTableProvider::GetResourceTablePath(void)
+{
+ return PATH_DEFAULT;
+}
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#include <CCategoryElement.h>\r
-\r
-#include <CDeviceElement.h>\r
-#include <ri-debug.h>\r
-\r
-CategoryElement::CategoryElement(char *category_name, char *category_type, int class_id, bool is_uhd_device)\r
-{\r
- m_element_name = category_name;\r
- m_element_type = category_type;\r
- m_class_id = class_id;\r
- m_id = 0;\r
- SetElementAttr(ELEMENT_CATEGORY);\r
- m_is_uhd_decoder = is_uhd_device;\r
-}\r
-\r
-CategoryElement::~CategoryElement()\r
-{\r
- ReleaseChildElement();\r
- m_child_element.clear();\r
-}\r
-\r
-void CategoryElement::AddChildElement(Element* child_elem)\r
-{\r
- m_child_element.insert(child_elem);\r
-}\r
-\r
-void CategoryElement::ReleaseChildElement(void)\r
-{\r
- for (std::set<Element*>::iterator iter = m_child_element.begin(); iter != m_child_element.end(); iter++)\r
- {\r
- DeviceElement* pDevice = dynamic_cast<DeviceElement*>(*iter);\r
- delete pDevice;\r
- }\r
-}\r
-\r
-// LCOV_EXCL_START\r
-void CategoryElement::PrintInfo(void)\r
-{\r
- RI_DBG("= CATEGORY INFO");\r
- RI_DBG("= Category Name : %s", m_element_name);\r
- RI_DBG("= Category Type : %s", m_element_type);\r
- RI_DBG("= Category ID : %d", m_id);\r
- RI_DBG("= Class : %d", m_class_id);\r
-\r
- for (std::set<Element*>::iterator iter = m_child_element.begin(); iter != m_child_element.end(); iter++) {\r
- DeviceElement* device = dynamic_cast<DeviceElement*>(*iter);\r
- if (device == NULL)\r
- RI_DBG("= cannot get device element");\r
- else\r
- device->PrintInfo();\r
- }\r
- RI_DBG("---------------------------------------------\n");\r
-}\r
-// LCOV_EXCL_STOP\r
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include <CCategoryElement.h>
+
+#include <CDeviceElement.h>
+#include <ri-debug.h>
+
+CategoryElement::CategoryElement(char *category_name, char *category_type, int class_id, bool is_uhd_device)
+{
+ m_element_name = category_name;
+ m_element_type = category_type;
+ m_class_id = class_id;
+ m_id = 0;
+ SetElementAttr(ELEMENT_CATEGORY);
+ m_is_uhd_decoder = is_uhd_device;
+}
+
+CategoryElement::~CategoryElement()
+{
+ ReleaseChildElement();
+ m_child_element.clear();
+}
+
+void CategoryElement::AddChildElement(Element* child_elem)
+{
+ m_child_element.insert(child_elem);
+}
+
+void CategoryElement::ReleaseChildElement(void)
+{
+ for (std::set<Element*>::iterator iter = m_child_element.begin(); iter != m_child_element.end(); iter++)
+ {
+ DeviceElement* pDevice = dynamic_cast<DeviceElement*>(*iter);
+ delete pDevice;
+ }
+}
+
+// LCOV_EXCL_START
+void CategoryElement::PrintInfo(void)
+{
+ RI_DBG("= CATEGORY INFO");
+ RI_DBG("= Category Name : %s", m_element_name);
+ RI_DBG("= Category Type : %s", m_element_type);
+ RI_DBG("= Category ID : %d", m_id);
+ RI_DBG("= Class : %d", m_class_id);
+
+ for (std::set<Element*>::iterator iter = m_child_element.begin(); iter != m_child_element.end(); iter++) {
+ DeviceElement* device = dynamic_cast<DeviceElement*>(*iter);
+ if (device == NULL)
+ RI_DBG("= cannot get device element");
+ else
+ device->PrintInfo();
+ }
+ RI_DBG("---------------------------------------------\n");
+}
+// LCOV_EXCL_STOP
}
m_child_element.clear();
-}
\ No newline at end of file
+}
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#include <CDeviceElement.h>\r
-\r
-#include <ri-debug.h>\r
-\r
-DeviceElement::DeviceElement(char *device_name,\r
- char *device_type,\r
- unsigned int device_bw,\r
- ri_mem_cluster_s* mem_cluster_info,\r
- int sharable_count,\r
- int mixing,\r
- int device_id,\r
- int is_main_device\r
- )\r
-{\r
- m_element_name = device_name;\r
- m_element_type = device_type;\r
- m_element_bw = device_bw;\r
- m_element_mem_cluster = mem_cluster_info;\r
- m_sharable_count = sharable_count;\r
- m_mixing = mixing;\r
- m_device_id = device_id;\r
- m_is_main_device = is_main_device;\r
-\r
- SetElementAttr(ELEMENT_DEVICE);\r
-\r
- m_class_id = 0;\r
- m_id = 0;\r
-}\r
-\r
-DeviceElement::~DeviceElement()\r
-{\r
- m_child_element.clear();\r
-}\r
-\r
-void DeviceElement::AddChildElement(Element* child_elem)\r
-{\r
- m_child_element.insert(child_elem);\r
-}\r
-\r
-void DeviceElement::ReleaseChildElement(void){}\r
-\r
-void DeviceElement::SetDevicePath(char *device_path)\r
-{\r
- m_device_path = strdup(device_path);\r
-}\r
-\r
-char *DeviceElement::GetDevicePath(void)\r
-{\r
- return m_device_path;\r
-}\r
-\r
-void DeviceElement::SetAudioCodec(char *name)\r
-{\r
- m_audio_codec = strdup(name);\r
-}\r
-\r
-\r
-void DeviceElement::SetOmxCompName(char *omx_comp_name)\r
-{\r
- m_omx_comp_name = strdup(omx_comp_name);\r
-}\r
-\r
-char *DeviceElement::GetOmxCompName(void)\r
-{\r
- return m_omx_comp_name;\r
-}\r
-\r
-// LCOV_EXCL_START\r
-void DeviceElement::PrintInfo(void)\r
-{\r
- RI_DBG("===== DEVICE INFO");\r
- RI_DBG("= Device Name : %s", m_element_name);\r
- RI_DBG("= Device id : %d", m_id);\r
-}\r
-// LCOV_EXCL_STOP\r
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include <CDeviceElement.h>
+
+#include <ri-debug.h>
+
+DeviceElement::DeviceElement(char *device_name,
+ char *device_type,
+ unsigned int device_bw,
+ ri_mem_cluster_s* mem_cluster_info,
+ int sharable_count,
+ int mixing,
+ int device_id,
+ int is_main_device
+ )
+{
+ m_element_name = device_name;
+ m_element_type = device_type;
+ m_element_bw = device_bw;
+ m_element_mem_cluster = mem_cluster_info;
+ m_sharable_count = sharable_count;
+ m_mixing = mixing;
+ m_device_id = device_id;
+ m_is_main_device = is_main_device;
+
+ SetElementAttr(ELEMENT_DEVICE);
+
+ m_class_id = 0;
+ m_id = 0;
+}
+
+DeviceElement::~DeviceElement()
+{
+ m_child_element.clear();
+}
+
+void DeviceElement::AddChildElement(Element* child_elem)
+{
+ m_child_element.insert(child_elem);
+}
+
+void DeviceElement::ReleaseChildElement(void){}
+
+void DeviceElement::SetDevicePath(char *device_path)
+{
+ m_device_path = strdup(device_path);
+}
+
+char *DeviceElement::GetDevicePath(void)
+{
+ return m_device_path;
+}
+
+void DeviceElement::SetAudioCodec(char *name)
+{
+ m_audio_codec = strdup(name);
+}
+
+
+void DeviceElement::SetOmxCompName(char *omx_comp_name)
+{
+ m_omx_comp_name = strdup(omx_comp_name);
+}
+
+char *DeviceElement::GetOmxCompName(void)
+{
+ return m_omx_comp_name;
+}
+
+// LCOV_EXCL_START
+void DeviceElement::PrintInfo(void)
+{
+ RI_DBG("===== DEVICE INFO");
+ RI_DBG("= Device Name : %s", m_element_name);
+ RI_DBG("= Device id : %d", m_id);
+}
+// LCOV_EXCL_STOP
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#include <cstddef>\r
-#include <CElement.h>\r
-\r
-\r
-Element::Element(void):m_element_name(NULL), m_element_type(NULL), m_class_id(0)\r
-{}\r
-\r
-Element::Element(char *element_name, char *element_type, int class_id, bool is_uhd_device)\r
-:m_element_name(element_name), m_element_type(element_type), m_class_id(class_id), m_is_uhd_decoder(is_uhd_device)\r
-{}\r
-\r
-Element::Element(char *element_name, char *element_type):m_element_name(element_name), m_element_type(element_type), m_class_id(0)\r
-{}\r
-\r
-Element::Element(char *element_name):m_element_name(element_name), m_element_type(NULL), m_class_id(0)\r
-{}\r
-\r
-void Element::SetElementAttr(ri_element_attribute_e element_attr)\r
-{\r
- //RI_DBG("[DEVICE ELEMENT] element attr : %s", element_attr);\r
- m_element_attr = element_attr;\r
-}\r
-\r
-ri_element_attribute_e Element::GetElementAttr(void)\r
-{\r
- return m_element_attr;\r
-}\r
-\r
-char *Element::GetElementName(void)\r
-{\r
- return m_element_name;\r
-}\r
-\r
-char *Element::GetElementType(void)\r
-{\r
- return m_element_type;\r
-}\r
-\r
-int Element::GetElementID(void)\r
-{\r
- return m_id;\r
-}\r
-\r
-void Element::SetElementID(unsigned int element_id)\r
-{\r
- m_id = element_id;\r
-}\r
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include <cstddef>
+#include <CElement.h>
+
+
+Element::Element(void):m_element_name(NULL), m_element_type(NULL), m_class_id(0)
+{}
+
+Element::Element(char *element_name, char *element_type, int class_id, bool is_uhd_device)
+:m_element_name(element_name), m_element_type(element_type), m_class_id(class_id), m_is_uhd_decoder(is_uhd_device)
+{}
+
+Element::Element(char *element_name, char *element_type):m_element_name(element_name), m_element_type(element_type), m_class_id(0)
+{}
+
+Element::Element(char *element_name):m_element_name(element_name), m_element_type(NULL), m_class_id(0)
+{}
+
+void Element::SetElementAttr(ri_element_attribute_e element_attr)
+{
+ //RI_DBG("[DEVICE ELEMENT] element attr : %s", element_attr);
+ m_element_attr = element_attr;
+}
+
+ri_element_attribute_e Element::GetElementAttr(void)
+{
+ return m_element_attr;
+}
+
+char *Element::GetElementName(void)
+{
+ return m_element_name;
+}
+
+char *Element::GetElementType(void)
+{
+ return m_element_type;
+}
+
+int Element::GetElementID(void)
+{
+ return m_id;
+}
+
+void Element::SetElementID(unsigned int element_id)
+{
+ m_id = element_id;
+}
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#include <CResourceInfoDoc.h>\r
-#include <ri-debug.h>\r
-\r
-ResourceInfoDoc::~ResourceInfoDoc(void)\r
-{\r
- ReleaseElements();\r
-}\r
-\r
-void ResourceInfoDoc::AddResourceCategory(CategoryElement* category)\r
-{\r
- if (!category) {\r
- RI_ERR("invalid category");\r
- return;\r
- }\r
-\r
- category_elements_.push_back(category);\r
-}\r
-\r
-void ResourceInfoDoc::PushElement(Element* element)\r
-{\r
- context_.push(element);\r
-}\r
-\r
-Element* ResourceInfoDoc::TopElement(void)\r
-{\r
- if (context_.empty())\r
- return nullptr;\r
-\r
- return context_.top();\r
-}\r
-\r
-void ResourceInfoDoc::PopElement(void)\r
-{\r
- if (context_.empty()) {\r
- RI_ERR("Context stack is empty, there is no element to pop");\r
- return;\r
- }\r
-\r
- return context_.pop();\r
-}\r
-\r
-void ResourceInfoDoc::ReleaseElements(void)\r
-{\r
- for (auto &it : category_elements_)\r
- delete it;\r
-\r
- category_elements_.clear();\r
-\r
- for (auto &it : decoding_elements_)\r
- delete it;\r
-\r
- decoding_elements_.clear();\r
-}\r
-\r
-void ResourceInfoDoc::AddDecodingElement(DecodingElement* element)\r
-{\r
- if (!element) {\r
- RI_ERR("invalid element");\r
- return;\r
- }\r
-\r
- decoding_elements_.push_back(element);\r
-}\r
-\r
-// LCOV_EXCL_START\r
-void ResourceInfoDoc::PrintInfo(void)\r
-{\r
- RI_DBG("\n---------------- INFORMATION ----------------");\r
- for (auto &it : category_elements_) {\r
- CategoryElement* category = dynamic_cast<CategoryElement*>(it);\r
- category->PrintInfo();\r
- }\r
-}\r
-// LCOV_EXCL_STOP\r
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include <CResourceInfoDoc.h>
+#include <ri-debug.h>
+
+ResourceInfoDoc::~ResourceInfoDoc(void)
+{
+ ReleaseElements();
+}
+
+void ResourceInfoDoc::AddResourceCategory(CategoryElement* category)
+{
+ if (!category) {
+ RI_ERR("invalid category");
+ return;
+ }
+
+ category_elements_.push_back(category);
+}
+
+void ResourceInfoDoc::PushElement(Element* element)
+{
+ context_.push(element);
+}
+
+Element* ResourceInfoDoc::TopElement(void)
+{
+ if (context_.empty())
+ return nullptr;
+
+ return context_.top();
+}
+
+void ResourceInfoDoc::PopElement(void)
+{
+ if (context_.empty()) {
+ RI_ERR("Context stack is empty, there is no element to pop");
+ return;
+ }
+
+ return context_.pop();
+}
+
+void ResourceInfoDoc::ReleaseElements(void)
+{
+ for (auto &it : category_elements_)
+ delete it;
+
+ category_elements_.clear();
+
+ for (auto &it : decoding_elements_)
+ delete it;
+
+ decoding_elements_.clear();
+}
+
+void ResourceInfoDoc::AddDecodingElement(DecodingElement* element)
+{
+ if (!element) {
+ RI_ERR("invalid element");
+ return;
+ }
+
+ decoding_elements_.push_back(element);
+}
+
+// LCOV_EXCL_START
+void ResourceInfoDoc::PrintInfo(void)
+{
+ RI_DBG("\n---------------- INFORMATION ----------------");
+ for (auto &it : category_elements_) {
+ CategoryElement* category = dynamic_cast<CategoryElement*>(it);
+ category->PrintInfo();
+ }
+}
+// LCOV_EXCL_STOP
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#include <assert.h>\r
-#include <ri-resource-info-parser.h>\r
-#include <ri-resource-info-dbmaker.h>\r
-\r
-static void CopyToResourceCategory(CategoryElement* category_element, ri_resource_category_s* category)\r
-{\r
- category->id = category_element->GetCategoryEnum();\r
- category->class_id = category_element->GetClassID();\r
- category->num_of_dev = category_element->GetNumOfChildElement();\r
- category->is_uhd_device = category_element->IsUHDDecoder();\r
-\r
- char *category_name = category_element->GetElementName();\r
- category->name = (category_name == NULL) ? strndup("", strlen("")): strndup(category_name, strlen(category_name));\r
-\r
- char *codec_name = category_element->GetCodecName();\r
- category->codec = (codec_name == NULL) ? strndup("", strlen("")): strndup(codec_name, strlen(codec_name));\r
-}\r
-\r
-static void CopyToDevice(DeviceElement* dev_element, CategoryElement* category_element, ri_device_common_attr_s* device)\r
-{\r
- device->id = dev_element->GetElementID();\r
- device->category = category_element->GetCategoryEnum();\r
- device->path = dev_element->GetDevicePath();\r
- device->bw = dev_element->GetDeviceBW();\r
- device->id_unique = dev_element->GetDeviceID();\r
- device->sharable_count = dev_element->GetSharableCount();\r
- device->mixing_count = dev_element->GetMixingCount();\r
- device->is_uhd_device = category_element->IsUHDDecoder();\r
- device->is_main_device = dev_element->IsMainDevice();\r
- device->omx_comp_name = dev_element->GetOmxCompName();\r
- device->audio_codec = dev_element->GetAudioCodec();\r
-\r
- char *dev_name = dev_element->GetElementName();\r
- device->name = (dev_name == NULL) ? strndup("", strlen("")): strndup(dev_name, strlen(dev_name));\r
-\r
- ri_mem_cluster_s* mem_info = dev_element->GetDeviceMemCluster();\r
-\r
- if (mem_info == NULL) {\r
- RI_ERR("can't get memory cluster info for (%s)", device->name);\r
- device->n_mem_clusters = 0;\r
- } else {\r
- device->n_mem_clusters = mem_info->count;\r
-\r
- for (unsigned int i = 0; i < mem_info->count; i++)\r
- device->mem_clusters[i] = mem_info->ids[i];\r
-\r
- free(mem_info);\r
- }\r
-\r
-}\r
-\r
-static void CopyToDeviceUniqueAttritue(DeviceElement* dev_elem, CategoryElement* category_elem, ri_device_unique_attr_s* attr)\r
-{\r
- attr->id = dev_elem->GetDeviceID();\r
- attr->category = category_elem->GetCategoryEnum();\r
- attr->path = dev_elem->GetDevicePath();\r
- attr->omx_comp_name = dev_elem->GetOmxCompName();\r
- attr->main_device = (dev_elem->IsMainDevice());\r
- attr->support_overlay = dev_elem->GetSupportOverlay();\r
- attr->max_rez = dev_elem->GetMaxResolution();\r
- attr->max_sampling_format = dev_elem->GetMaxSamplingFormat();\r
-\r
- //RI_INFO("id(%d)/support_overlay(%d)/max_rez(%d)/max_sampling(%d)", attr->id, attr->support_overlay, attr->max_rez, attr->max_sampling_format);\r
-\r
- char *dev_name = dev_elem->GetElementName();\r
- attr->name = (dev_name == NULL) ? strndup("", strlen("")): strndup(dev_name, strlen(dev_name));\r
-}\r
-\r
-int ConstructResourceDB(void *InfoDB, std::vector<CategoryElement*>* device_info)\r
-{\r
- CResourceInfoDB* db = static_cast<CResourceInfoDB*>(InfoDB);\r
- bool is_vdec_category = false;\r
-\r
- for (std::vector<CategoryElement*>::iterator iter = device_info->begin(); iter != device_info->end(); iter++) {\r
- CategoryElement* category_element = *iter;\r
- ri_resource_category_s* category = (ri_resource_category_s*) malloc (sizeof(ri_resource_category_s));\r
-\r
- assert(category);\r
-\r
- CopyToResourceCategory(category_element, category);\r
- db->AddCategoryInfo(category);\r
-\r
- CCategory* cat = FindVideoCategory(category->id);\r
- is_vdec_category = (cat == nullptr) ? false:true;\r
-\r
- for (std::set<Element*>::iterator iter_dev = category_element->GetChildElement()->begin(); iter_dev != category_element->GetChildElement()->end(); iter_dev++) {\r
- DeviceElement* dev_elem = dynamic_cast<DeviceElement*>(*iter_dev);\r
- assert(dev_elem);\r
-\r
- ri_device_common_attr_s* device = (ri_device_common_attr_s*) malloc (sizeof(ri_device_common_attr_s));\r
- assert(device);\r
-\r
- CopyToDevice(dev_elem, category_element, device);\r
-\r
- db->AddDeviceAttributes(device);\r
-\r
- if (is_vdec_category && !cat->SupportNDecoding())\r
- db->AddVideoDecoder(device->id_unique, cat->GetCodecName(), cat->GetResolution(), cat->GetFrameRate());\r
-\r
- if (db->HasDeviceUniqueAttributes(device->id_unique))\r
- continue;\r
-\r
- ri_device_unique_attr_s* dev_unique_attr = (ri_device_unique_attr_s*) malloc (sizeof(ri_device_unique_attr_s));\r
- assert(dev_unique_attr);\r
-\r
- CopyToDeviceUniqueAttritue(dev_elem, category_element, dev_unique_attr);\r
- db->AddDeviceUniqueAttributes(device->id_unique, dev_unique_attr);\r
- }\r
- }\r
- return RI_OK;\r
-}\r
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include <assert.h>
+#include <ri-resource-info-parser.h>
+#include <ri-resource-info-dbmaker.h>
+
+static void CopyToResourceCategory(CategoryElement* category_element, ri_resource_category_s* category)
+{
+ category->id = category_element->GetCategoryEnum();
+ category->class_id = category_element->GetClassID();
+ category->num_of_dev = category_element->GetNumOfChildElement();
+ category->is_uhd_device = category_element->IsUHDDecoder();
+
+ char *category_name = category_element->GetElementName();
+ category->name = (category_name == NULL) ? strndup("", strlen("")): strndup(category_name, strlen(category_name));
+
+ char *codec_name = category_element->GetCodecName();
+ category->codec = (codec_name == NULL) ? strndup("", strlen("")): strndup(codec_name, strlen(codec_name));
+}
+
+static void CopyToDevice(DeviceElement* dev_element, CategoryElement* category_element, ri_device_common_attr_s* device)
+{
+ device->id = dev_element->GetElementID();
+ device->category = category_element->GetCategoryEnum();
+ device->path = dev_element->GetDevicePath();
+ device->bw = dev_element->GetDeviceBW();
+ device->id_unique = dev_element->GetDeviceID();
+ device->sharable_count = dev_element->GetSharableCount();
+ device->mixing_count = dev_element->GetMixingCount();
+ device->is_uhd_device = category_element->IsUHDDecoder();
+ device->is_main_device = dev_element->IsMainDevice();
+ device->omx_comp_name = dev_element->GetOmxCompName();
+ device->audio_codec = dev_element->GetAudioCodec();
+
+ char *dev_name = dev_element->GetElementName();
+ device->name = (dev_name == NULL) ? strndup("", strlen("")): strndup(dev_name, strlen(dev_name));
+
+ ri_mem_cluster_s* mem_info = dev_element->GetDeviceMemCluster();
+
+ if (mem_info == NULL) {
+ RI_ERR("can't get memory cluster info for (%s)", device->name);
+ device->n_mem_clusters = 0;
+ } else {
+ device->n_mem_clusters = mem_info->count;
+
+ for (unsigned int i = 0; i < mem_info->count; i++)
+ device->mem_clusters[i] = mem_info->ids[i];
+
+ free(mem_info);
+ }
+
+}
+
+static void CopyToDeviceUniqueAttritue(DeviceElement* dev_elem, CategoryElement* category_elem, ri_device_unique_attr_s* attr)
+{
+ attr->id = dev_elem->GetDeviceID();
+ attr->category = category_elem->GetCategoryEnum();
+ attr->path = dev_elem->GetDevicePath();
+ attr->omx_comp_name = dev_elem->GetOmxCompName();
+ attr->main_device = (dev_elem->IsMainDevice());
+ attr->support_overlay = dev_elem->GetSupportOverlay();
+ attr->max_rez = dev_elem->GetMaxResolution();
+ attr->max_sampling_format = dev_elem->GetMaxSamplingFormat();
+
+ //RI_INFO("id(%d)/support_overlay(%d)/max_rez(%d)/max_sampling(%d)", attr->id, attr->support_overlay, attr->max_rez, attr->max_sampling_format);
+
+ char *dev_name = dev_elem->GetElementName();
+ attr->name = (dev_name == NULL) ? strndup("", strlen("")): strndup(dev_name, strlen(dev_name));
+}
+
+int ConstructResourceDB(void *InfoDB, std::vector<CategoryElement*>* device_info)
+{
+ CResourceInfoDB* db = static_cast<CResourceInfoDB*>(InfoDB);
+ bool is_vdec_category = false;
+
+ for (std::vector<CategoryElement*>::iterator iter = device_info->begin(); iter != device_info->end(); iter++) {
+ CategoryElement* category_element = *iter;
+ ri_resource_category_s* category = (ri_resource_category_s*) malloc (sizeof(ri_resource_category_s));
+
+ assert(category);
+
+ CopyToResourceCategory(category_element, category);
+ db->AddCategoryInfo(category);
+
+ CCategory* cat = FindVideoCategory(category->id);
+ is_vdec_category = (cat == nullptr) ? false:true;
+
+ for (std::set<Element*>::iterator iter_dev = category_element->GetChildElement()->begin(); iter_dev != category_element->GetChildElement()->end(); iter_dev++) {
+ DeviceElement* dev_elem = dynamic_cast<DeviceElement*>(*iter_dev);
+ assert(dev_elem);
+
+ ri_device_common_attr_s* device = (ri_device_common_attr_s*) malloc (sizeof(ri_device_common_attr_s));
+ assert(device);
+
+ CopyToDevice(dev_elem, category_element, device);
+
+ db->AddDeviceAttributes(device);
+
+ if (is_vdec_category && !cat->SupportNDecoding())
+ db->AddVideoDecoder(device->id_unique, cat->GetCodecName(), cat->GetResolution(), cat->GetFrameRate());
+
+ if (db->HasDeviceUniqueAttributes(device->id_unique))
+ continue;
+
+ ri_device_unique_attr_s* dev_unique_attr = (ri_device_unique_attr_s*) malloc (sizeof(ri_device_unique_attr_s));
+ assert(dev_unique_attr);
+
+ CopyToDeviceUniqueAttritue(dev_elem, category_element, dev_unique_attr);
+ db->AddDeviceUniqueAttributes(device->id_unique, dev_unique_attr);
+ }
+ }
+ return RI_OK;
+}
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#include <sys/types.h>\r
-#include <unistd.h>\r
-#include <assert.h>\r
-#include <glib.h>\r
-#include <ri-macro.h>\r
-#include <ri-vdec-api.h>\r
-#include <CVideoCodec.h>\r
-#include <CVideoResolution.h>\r
-#include <CResourceInfoDB.h>\r
-\r
-// LCOV_EXCL_START\r
-\r
-int ri_get_video_decoder_list(ri_resource_list_h *list)\r
-{\r
- RI_RETURN_MINUS_IF_NULL(list, "invalid param");\r
- return CResourceInfoDB::GetInstance()->GetVideoDecoderList(list);\r
-}\r
-\r
-static void ri_free_video_codec(gpointer data)\r
-{\r
- ri_vcodec *vcodec = (ri_vcodec *) data;\r
- RI_RETURN_IF_NULL(vcodec, "invalid vcodec");\r
-\r
- RI_FREE(vcodec->codec_name);\r
- RI_FREE(vcodec);\r
-}\r
-\r
-static void ri_free_video_decoder(gpointer data)\r
-{\r
- ri_video_decoder *vdec = (ri_video_decoder *) data;\r
- RI_RETURN_IF_NULL(vdec, "invalid vdec");\r
-\r
- g_list_free_full(vdec->codec_list, ri_free_video_codec);\r
- RI_FREE(vdec);\r
-}\r
-\r
-void ri_free_video_decoder_list(ri_resource_list_h list)\r
-{\r
- RI_RETURN_IF_NULL(list, "invalid list");\r
-\r
- g_list_free_full(list->rsc_list, ri_free_video_decoder);\r
- RI_FREE(list);\r
-}\r
-\r
-ri_video_decoder_h ri_vdec_list_get_next(ri_resource_list_h list)\r
-{\r
- RI_RETURN_NULL_IF_NULL(list, "invalid list");\r
-\r
- GList *tmp = g_list_next(list->iter);\r
- RI_RETURN_NULL_IF_NULL(tmp, "no next video decoder");\r
-\r
- list->iter = tmp;\r
- return (ri_video_decoder_h) list->iter->data;\r
-}\r
-\r
-ri_video_decoder_h ri_vdec_list_get_prev(ri_resource_list_h list)\r
-{\r
- RI_RETURN_NULL_IF_NULL(list, "invalid list");\r
-\r
- GList *tmp = g_list_previous(list->iter);\r
- RI_RETURN_NULL_IF_NULL(tmp, "no prev video decoder");\r
-\r
- list->iter = tmp;\r
- return (ri_video_decoder_h) list->iter->data;\r
-}\r
-\r
-ri_video_decoder_h ri_vdec_list_get_first(ri_resource_list_h list)\r
-{\r
- RI_RETURN_NULL_IF_NULL(list, "invalid list");\r
-\r
- GList *tmp = g_list_first(list->rsc_list);\r
- RI_RETURN_NULL_IF_NULL(tmp, "no first video decoder");\r
-\r
- list->iter = tmp;\r
- return (ri_video_decoder_h) list->iter->data;\r
-}\r
-\r
-ri_video_decoder_h ri_vdec_list_get_last(ri_resource_list_h list)\r
-{\r
- RI_RETURN_NULL_IF_NULL(list, "invalid list");\r
-\r
- GList *tmp = g_list_last(list->rsc_list);\r
- RI_RETURN_NULL_IF_NULL(tmp, "no last video decoder");\r
-\r
- list->iter = tmp;\r
- return (ri_video_decoder_h) list->iter->data;\r
-}\r
-\r
-int ri_vdec_list_get_count(ri_resource_list_h list)\r
-{\r
- return (list) ? list->n_rsc:0;\r
-}\r
-\r
-int ri_vdec_get_id(ri_video_decoder_h vdec)\r
-{\r
- RI_RETURN_MINUS_IF_NULL(vdec, "invalid vdec");\r
- return vdec->id;\r
-}\r
-\r
-int ri_vdec_get_supported_codec_count(ri_video_decoder_h vdec)\r
-{\r
- return (vdec) ? vdec->n_codecs:0;\r
-}\r
-\r
-ri_video_codec_h ri_vdec_get_codec_next(ri_video_decoder_h vdec)\r
-{\r
- RI_RETURN_NULL_IF_NULL(vdec, "invalid vdec");\r
-\r
- GList *tmp = g_list_next(vdec->iter);\r
- RI_RETURN_NULL_IF_NULL(tmp, "no next video codec");\r
-\r
- vdec->iter = tmp;\r
- return (ri_video_codec_h) vdec->iter->data;\r
-}\r
-\r
-ri_video_codec_h ri_vdec_get_codec_prev(ri_video_decoder_h vdec)\r
-{\r
- RI_RETURN_NULL_IF_NULL(vdec, "invalid vdec");\r
-\r
- GList *tmp = g_list_previous(vdec->iter);\r
- RI_RETURN_NULL_IF_NULL(tmp, "no prev video codec");\r
-\r
- vdec->iter = tmp;\r
- return (ri_video_codec_h) vdec->iter->data;\r
-}\r
-\r
-ri_video_codec_h ri_vdec_get_codec_first(ri_video_decoder_h vdec)\r
-{\r
- RI_RETURN_NULL_IF_NULL(vdec, "invalid vdec");\r
-\r
- GList *tmp = g_list_first(vdec->codec_list);\r
- RI_RETURN_NULL_IF_NULL(tmp, "no first video codec");\r
-\r
- vdec->iter = tmp;\r
- return (ri_video_codec_h) vdec->iter->data;\r
-}\r
-\r
-ri_video_codec_h ri_vdec_get_codec_last(ri_video_decoder_h vdec)\r
-{\r
- RI_RETURN_NULL_IF_NULL(vdec, "invalid vdec");\r
-\r
- GList *tmp = g_list_last(vdec->codec_list);\r
- RI_RETURN_NULL_IF_NULL(tmp, "no last video codec");\r
-\r
- vdec->iter = tmp;\r
- return (ri_video_codec_h) vdec->iter->data;\r
-}\r
-\r
-const char* ri_vcodec_get_name(ri_video_codec_h vcodec)\r
-{\r
- RI_RETURN_NULL_IF_NULL(vcodec, "invalid vcodec");\r
- return vcodec->codec_name;\r
-}\r
-\r
-int ri_vcodec_get_max_resolution(ri_video_codec_h vcodec, int *w, int *h, int *f)\r
-{\r
- RI_RETURN_MINUS_IF_NULL(vcodec, "invalid vcodec");\r
- RI_RETURN_MINUS_IF_NULL(w, "invalid param");\r
- RI_RETURN_MINUS_IF_NULL(h, "invalid param");\r
- RI_RETURN_MINUS_IF_NULL(f, "invalid param");\r
-\r
- CVideoResolution::GetResolutionSize(vcodec->rsz_id, w, h);\r
- *f = vcodec->framerate;\r
- return 0;\r
-}\r
-\r
-// LCOV_EXCL_STOP\r
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include <sys/types.h>
+#include <unistd.h>
+#include <assert.h>
+#include <glib.h>
+#include <ri-macro.h>
+#include <ri-vdec-api.h>
+#include <CVideoCodec.h>
+#include <CVideoResolution.h>
+#include <CResourceInfoDB.h>
+
+// LCOV_EXCL_START
+
+int ri_get_video_decoder_list(ri_resource_list_h *list)
+{
+ RI_RETURN_MINUS_IF_NULL(list, "invalid param");
+ return CResourceInfoDB::GetInstance()->GetVideoDecoderList(list);
+}
+
+static void ri_free_video_codec(gpointer data)
+{
+ ri_vcodec *vcodec = (ri_vcodec *) data;
+ RI_RETURN_IF_NULL(vcodec, "invalid vcodec");
+
+ RI_FREE(vcodec->codec_name);
+ RI_FREE(vcodec);
+}
+
+static void ri_free_video_decoder(gpointer data)
+{
+ ri_video_decoder *vdec = (ri_video_decoder *) data;
+ RI_RETURN_IF_NULL(vdec, "invalid vdec");
+
+ g_list_free_full(vdec->codec_list, ri_free_video_codec);
+ RI_FREE(vdec);
+}
+
+void ri_free_video_decoder_list(ri_resource_list_h list)
+{
+ RI_RETURN_IF_NULL(list, "invalid list");
+
+ g_list_free_full(list->rsc_list, ri_free_video_decoder);
+ RI_FREE(list);
+}
+
+ri_video_decoder_h ri_vdec_list_get_next(ri_resource_list_h list)
+{
+ RI_RETURN_NULL_IF_NULL(list, "invalid list");
+
+ GList *tmp = g_list_next(list->iter);
+ RI_RETURN_NULL_IF_NULL(tmp, "no next video decoder");
+
+ list->iter = tmp;
+ return (ri_video_decoder_h) list->iter->data;
+}
+
+ri_video_decoder_h ri_vdec_list_get_prev(ri_resource_list_h list)
+{
+ RI_RETURN_NULL_IF_NULL(list, "invalid list");
+
+ GList *tmp = g_list_previous(list->iter);
+ RI_RETURN_NULL_IF_NULL(tmp, "no prev video decoder");
+
+ list->iter = tmp;
+ return (ri_video_decoder_h) list->iter->data;
+}
+
+ri_video_decoder_h ri_vdec_list_get_first(ri_resource_list_h list)
+{
+ RI_RETURN_NULL_IF_NULL(list, "invalid list");
+
+ GList *tmp = g_list_first(list->rsc_list);
+ RI_RETURN_NULL_IF_NULL(tmp, "no first video decoder");
+
+ list->iter = tmp;
+ return (ri_video_decoder_h) list->iter->data;
+}
+
+ri_video_decoder_h ri_vdec_list_get_last(ri_resource_list_h list)
+{
+ RI_RETURN_NULL_IF_NULL(list, "invalid list");
+
+ GList *tmp = g_list_last(list->rsc_list);
+ RI_RETURN_NULL_IF_NULL(tmp, "no last video decoder");
+
+ list->iter = tmp;
+ return (ri_video_decoder_h) list->iter->data;
+}
+
+int ri_vdec_list_get_count(ri_resource_list_h list)
+{
+ return (list) ? list->n_rsc:0;
+}
+
+int ri_vdec_get_id(ri_video_decoder_h vdec)
+{
+ RI_RETURN_MINUS_IF_NULL(vdec, "invalid vdec");
+ return vdec->id;
+}
+
+int ri_vdec_get_supported_codec_count(ri_video_decoder_h vdec)
+{
+ return (vdec) ? vdec->n_codecs:0;
+}
+
+ri_video_codec_h ri_vdec_get_codec_next(ri_video_decoder_h vdec)
+{
+ RI_RETURN_NULL_IF_NULL(vdec, "invalid vdec");
+
+ GList *tmp = g_list_next(vdec->iter);
+ RI_RETURN_NULL_IF_NULL(tmp, "no next video codec");
+
+ vdec->iter = tmp;
+ return (ri_video_codec_h) vdec->iter->data;
+}
+
+ri_video_codec_h ri_vdec_get_codec_prev(ri_video_decoder_h vdec)
+{
+ RI_RETURN_NULL_IF_NULL(vdec, "invalid vdec");
+
+ GList *tmp = g_list_previous(vdec->iter);
+ RI_RETURN_NULL_IF_NULL(tmp, "no prev video codec");
+
+ vdec->iter = tmp;
+ return (ri_video_codec_h) vdec->iter->data;
+}
+
+ri_video_codec_h ri_vdec_get_codec_first(ri_video_decoder_h vdec)
+{
+ RI_RETURN_NULL_IF_NULL(vdec, "invalid vdec");
+
+ GList *tmp = g_list_first(vdec->codec_list);
+ RI_RETURN_NULL_IF_NULL(tmp, "no first video codec");
+
+ vdec->iter = tmp;
+ return (ri_video_codec_h) vdec->iter->data;
+}
+
+ri_video_codec_h ri_vdec_get_codec_last(ri_video_decoder_h vdec)
+{
+ RI_RETURN_NULL_IF_NULL(vdec, "invalid vdec");
+
+ GList *tmp = g_list_last(vdec->codec_list);
+ RI_RETURN_NULL_IF_NULL(tmp, "no last video codec");
+
+ vdec->iter = tmp;
+ return (ri_video_codec_h) vdec->iter->data;
+}
+
+const char* ri_vcodec_get_name(ri_video_codec_h vcodec)
+{
+ RI_RETURN_NULL_IF_NULL(vcodec, "invalid vcodec");
+ return vcodec->codec_name;
+}
+
+int ri_vcodec_get_max_resolution(ri_video_codec_h vcodec, int *w, int *h, int *f)
+{
+ RI_RETURN_MINUS_IF_NULL(vcodec, "invalid vcodec");
+ RI_RETURN_MINUS_IF_NULL(w, "invalid param");
+ RI_RETURN_MINUS_IF_NULL(h, "invalid param");
+ RI_RETURN_MINUS_IF_NULL(f, "invalid param");
+
+ CVideoResolution::GetResolutionSize(vcodec->rsz_id, w, h);
+ *f = vcodec->framerate;
+ return 0;
+}
+
+// LCOV_EXCL_STOP
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#include <stdio.h>\r
-\r
-#include <CResourceInfoDB.h>\r
-\r
-#include <ri-resource-info-parser.h>\r
-\r
-// LCOV_EXCL_START\r
-static void print_help(const char *argv)\r
-{\r
- printf("Usage : %s {resource info file path}\n", argv);\r
-}\r
-\r
-int main(int argc, char *argv[])\r
-{\r
- if (argc != 2) {\r
- printf("invalid argument(%d)\n", argc);\r
- print_help(argv[0]);\r
- return -1;\r
- }\r
-\r
- CResourceInfoDB* infoDB = new CResourceInfoDB();\r
-\r
- if (ParseXMLFile(static_cast<void*> (infoDB), argv[1]) != 0) {\r
- printf("%c[1;33m",27);\r
- printf("[ FAIL ] invalid resource info file : %s", argv[1]);\r
- printf("%c[0m\n",27);\r
- return -1;\r
- }\r
-\r
- printf("[ PASS ] valid resource info file %s\n", argv[1]);\r
-\r
- return 0;\r
-}\r
-// LCOV_EXCL_END\r
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include <stdio.h>
+
+#include <CResourceInfoDB.h>
+
+#include <ri-resource-info-parser.h>
+
+// LCOV_EXCL_START
+static void print_help(const char *argv)
+{
+ printf("Usage : %s {resource info file path}\n", argv);
+}
+
+int main(int argc, char *argv[])
+{
+ if (argc != 2) {
+ printf("invalid argument(%d)\n", argc);
+ print_help(argv[0]);
+ return -1;
+ }
+
+ CResourceInfoDB* infoDB = new CResourceInfoDB();
+
+ if (ParseXMLFile(static_cast<void*> (infoDB), argv[1]) != 0) {
+ printf("%c[1;33m",27);
+ printf("[ FAIL ] invalid resource info file : %s", argv[1]);
+ printf("%c[0m\n",27);
+ return -1;
+ }
+
+ printf("[ PASS ] valid resource info file %s\n", argv[1]);
+
+ return 0;
+}
+// LCOV_EXCL_END
-/*\r
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#ifndef __TC_TABLE_PROVIDER_MOCK__\r
-#define __TC_TABLE_PROVIDER_MOCK__\r
-#include "gmock/gmock.h"\r
-#include "gtest/gtest.h"\r
-#include <CModelInfo.h>\r
-#include <CResourceTableProvider.h>\r
-\r
-using namespace testing;\r
-\r
-class MockModelInfo : public CModelInfo\r
-{\r
-public:\r
- MOCK_CONST_METHOD0(GetResourceTableIndex, int());\r
- MOCK_CONST_METHOD0(IsEmulator, bool());\r
- MOCK_CONST_METHOD0(SupportAndroidOnTizen, bool());\r
-};\r
-\r
-#endif //__TC_TABLE_PROVIDER_MOCK__\r
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#ifndef __TC_TABLE_PROVIDER_MOCK__
+#define __TC_TABLE_PROVIDER_MOCK__
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include <CModelInfo.h>
+#include <CResourceTableProvider.h>
+
+using namespace testing;
+
+class MockModelInfo : public CModelInfo
+{
+public:
+ MOCK_CONST_METHOD0(GetResourceTableIndex, int());
+ MOCK_CONST_METHOD0(IsEmulator, bool());
+ MOCK_CONST_METHOD0(SupportAndroidOnTizen, bool());
+};
+
+#endif //__TC_TABLE_PROVIDER_MOCK__