V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
elone
V2EX  ›  iOS

ios extension 获取到的 CMSampleBuffer,如何传给 main container?

  •  
  •   elone · 2021-07-30 11:42:31 +08:00 · 1589 次点击
    这是一个创建于 972 天前的主题,其中的信息可能已经有所发展或是发生改变。

    最近在学 flutter native 混合开发,调用 replaykit2 获取到 cmsamplebuffer 数据,想保存为 mp4,以供 flutter 可以读取 。

    ios 开发是最近两天在学,还很混乱。ios extension 和主 container 是不同的沙盒环境吗?怎么样才可以把 extension 中保存的文件共享到 main container ?

    还是说,把 cmsamplebuffer 传给 ios appdelegate.swift,在 appdelegate 里处理?

    求大家给个思路,不知道是不是姿势不对,翻了一天 google 了。

    4 条回复    2021-07-30 17:20:13 +08:00
    finab
        1
    finab  
       2021-07-30 11:47:10 +08:00
    关键词 App Groups
    elone
        2
    elone  
    OP
       2021-07-30 11:50:46 +08:00
    @finab 谢谢,我有试过,但是似乎需要 将 cmsamplebuffer 转成 Data (swift) ?
    Building
        3
    Building  
       2021-07-30 13:55:47 +08:00 via iPhone
    FileManager: containerURLForSecurityApplicationGroupIdentifier
    z1113456051
        4
    z1113456051  
       2021-07-30 17:20:13 +08:00
    最简单做法肯定是视频合成好了,通过沙盒共享过去。但是子进程有内存限制。大视频还是要一帧一帧的发到主程序处理。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1124 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 22:52 · PVG 06:52 · LAX 15:52 · JFK 18:52
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.