bl双性强迫侵犯h_国产在线观看人成激情视频_蜜芽188_被诱拐的少孩全彩啪啪漫画

Android怎么實現外接USB攝像頭

這篇文章主要講解了“Android怎么實現外接USB攝像頭”,文中的講解內容簡單清晰,易于學習與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學習“Android怎么實現外接USB攝像頭”吧!

10年積累的網站設計制作、成都網站設計經驗,可以快速應對客戶對網站的新想法和需求。提供各種問題對應的解決方案。讓選擇我們的客戶得到更好、更有力的網絡服務。我雖然不認識你,你也不認識我。但先網站制作后付款的網站建設流程,更有大通免費網站建設讓你可以放心的選擇與我們合作。

實現

系統必須支持 android.hardware.usb.host

/system/etc/permissions下需要添加host的聲明
<feature name=“android.hardware.usb.host” />

此外&#xff0c;還必須啟用Kernel的 UVC 設備內核。

+CONFIG_USB_VIDEO_CLASS=y
+CONFIG_MEDIA_USB_SUPPORT=y

要在相應的設備細分版本中啟用外接攝像頭提供程序&#xff0c;以便添加必要的 SELinux 權限、外接攝像頭配置以及外接攝像頭提供程序依賴項&#xff0c;請完成以下步驟&#xff1a;

  • 將外接攝像頭配置文件和外接攝像頭庫添加到 device.mk。

    +PRODUCT_PACKAGES += android.hardware.camera.provider@2.4-impl
    +PRODUCT_PACKAGES += android.hardware.camera.provider@2.4-external-service

    +PRODUCT_COPY_FILES +=
    +device/manufacturerX/productY/external_camera_config.xml:$(TARGET_COPY_OUT_VENDOR )/etc/external_camera_config.xml

  • 將外接攝像頭提供程序名稱添加到設備 Treble HAL 清單。

    <hal format=“hidl”>
    <name>android.hardware.camera.provider</name>
    <transport arch=“32+64”>passthrough</transport>
    <impl level=“generic”></impl>
    <version>2.4</version>
    <interface>
    <name>ICameraProvider</name>
    <instance>legacy/0</instance>
    + <instance>external/0</instance>
    </interface>
    </hal>

  • &#xff08;選做&#xff09;如果設備在 Treble 直通模式下運行&#xff0c;請更新 sepolicy&#xff0c;以便 cameraserver 可以訪問 UVC 攝像頭。

    +# for external camera
    +allow cameraserver device:dir r_dir_perms;
    +allow cameraserver video_device:dir r_dir_perms;
    +allow cameraserver video_device:chr_file rw_file_perms;

external_camera_config.xml的示例

<ExternalCamera>
   <Provider>   <ignore> <!-- Internal video devices to be ignored by external camera HAL -->   <id>0</id>           <!-- No leading/trailing spaces -->   <id>1</id> 
       </ignore>
   </Provider>
   <!-- See ExternalCameraUtils.cpp for default values of Device configurations below-->
   <Device>   <!-- Max JPEG buffer size in bytes-->   <MaxJpegBufferSize  bytes="8388608"/>  <!-- 8MB (> 2594x1944 YUV420) -->   <!-- Size of v4l2 buffer queue when streaming >= 30fps -->   <!-- Larger value: more request can be cached pipeline (less janky) -->   <!-- Smaller value: use less memory -->   <NumVideoBuffers  count="4"/>   <!-- Size of v4l2 buffer queue when streaming < 30fps -->   <NumStillBuffers  count="2"/>   <!-- List of maximum fps for various output sizes -->   <!-- Any image size smaller than the size listed in Limit row will report
       fps (as minimum frame duration) up to the fpsBound value. -->   <FpsList>   <!-- width/height must be increasing, fpsBound must be decreasing-->   <Limit  width="640" height="480" fpsBound="30.0" />   <Limit  width="1280" height="720" fpsBound="30.0" />   <Limit  width="1920" height="1080" fpsBound="30.0" />   <!-- image size larger than the last entry will not be supported-->   </FpsList>
   </Device></ExternalCamera>

您可以通過修改 external_camera_config.xml 文件來自定義外接攝像頭提供程序。具體而言&#xff0c;客戶可以自定義以下參數&#xff1a;

  • 內部攝像頭的排除視頻節點

  • 支持的圖片大小和幀速率上限

  • Inflight 緩沖區數量&#xff08;在卡頓與內存之間進行權衡&#xff09;

除了這些參數之外&#xff0c;您還可以添加自己的參數或開發自己的配置。

感謝各位的閱讀,以上就是“Android怎么實現外接USB攝像頭”的內容了,經過本文的學習后,相信大家對Android怎么實現外接USB攝像頭這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是創新互聯,小編將為大家推送更多相關知識點的文章,歡迎關注!

新聞標題:Android怎么實現外接USB攝像頭
網頁路徑:http://vcdvsql.cn/article26/iighcg.html

成都網站建設公司_創新互聯,為您提供定制網站網站維護自適應網站、App設計定制開發手機網站建設

廣告

聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯

外貿網站建設