tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

PRemoteDecoder.ipdl (2918B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* This Source Code Form is subject to the terms of the Mozilla Public
      3  * License, v. 2.0. If a copy of the MPL was not distributed with this
      4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      5 
      6 include "mozilla/dom/MediaIPCUtils.h";
      7 
      8 include protocol PRemoteMediaManager;
      9 
     10 using mozilla::MediaDataDecoder::ConversionRequired from "PlatformDecoderModule.h";
     11 using mozilla::MediaDataDecoder::PropertyName from "PlatformDecoderModule.h";
     12 using mozilla::MediaDataDecoder::PropertyValue from "PlatformDecoderModule.h";
     13 using mozilla::TrackInfo::TrackType from "MediaInfo.h";
     14 using mozilla::layers::LayersBackend from "mozilla/layers/LayersTypes.h";
     15 using mozilla::MediaResult from "MediaResult.h";
     16 [RefCounted] using class mozilla::ArrayOfRemoteMediaRawData from "mozilla/RemoteMediaData.h";
     17 [RefCounted] using class mozilla::ArrayOfRemoteAudioData from "mozilla/RemoteMediaData.h";
     18 [RefCounted] using class mozilla::ArrayOfRemoteVideoData from "mozilla/RemoteMediaData.h";
     19 include PMediaDecoderParams;
     20 include LayersSurfaces;
     21 
     22 namespace mozilla {
     23 
     24 union DecodedOutputIPDL
     25 {
     26   nullable ArrayOfRemoteAudioData;
     27   nullable ArrayOfRemoteVideoData;
     28 };
     29 
     30 struct DecodePropertyIPDL {
     31   PropertyName name;
     32   PropertyValue value;
     33 };
     34 
     35 struct InitCompletionIPDL
     36 {
     37   TrackType type;
     38   nsCString decoderDescription;
     39   nsCString decoderProcessName;
     40   nsCString decoderCodecName;
     41   bool hardware;
     42   nsCString hardwareReason;
     43   ConversionRequired conversion;
     44   bool shouldDecoderAlwaysBeRecycled;
     45   DecodePropertyIPDL[] decodeProperties;
     46 };
     47 
     48 union InitResultIPDL
     49 {
     50   MediaResult;
     51   InitCompletionIPDL;
     52 };
     53 
     54 union DecodeResultIPDL
     55 {
     56   MediaResult;
     57   DecodedOutputIPDL;
     58 };
     59 
     60 // This protocol provides a way to use MediaDataDecoder across processes.
     61 // The parent side currently is only implemented to work with
     62 // RemoteDecoderModule or WindowsMediaFoundation.
     63 // The child side runs in the content process, and the parent side runs
     64 // in the RDD process or the GPU process. We run a separate IPDL thread
     65 // for both sides.
     66 [ManualDealloc]
     67 async protocol PRemoteDecoder
     68 {
     69   manager PRemoteMediaManager;
     70 parent:
     71   async Construct() returns (MediaResult result);
     72 
     73   async Init() returns (InitResultIPDL result);
     74 
     75   // Each output may include a SurfaceDescriptorGPUVideo that represents the decoded
     76   // frame. This SurfaceDescriptor can be used on the Layers IPDL protocol, but
     77   // must be released explicitly using DeallocateSurfaceDescriptorGPUVideo
     78   // on the manager protocol.
     79   async Decode(nullable ArrayOfRemoteMediaRawData data) returns (DecodeResultIPDL result);
     80   async Flush() returns (MediaResult error);
     81   async Drain() returns (DecodeResultIPDL result);
     82   async Shutdown() returns (bool unused);
     83   // To clear the threshold, call with INT64_MIN.
     84   async SetSeekThreshold(TimeUnit time);
     85 
     86   async __delete__();
     87 };
     88 
     89 } // namespace mozilla