tor-browser

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

PRemoteEncoder.ipdl (2546B)


      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 include "mozilla/RemoteMediaDataEncoderChild.h";
      8 include "mozilla/RemoteMediaDataEncoderParent.h";
      9 
     10 include protocol PRemoteMediaManager;
     11 
     12 using mozilla::EncoderConfig from "EncoderConfig.h";
     13 using mozilla::MediaResult from "MediaResult.h";
     14 [RefCounted] using class mozilla::ArrayOfRemoteMediaRawData from "mozilla/RemoteMediaData.h";
     15 [RefCounted] using class mozilla::ArrayOfRemoteAudioData from "mozilla/RemoteMediaData.h";
     16 [RefCounted] using class mozilla::ArrayOfRemoteVideoData from "mozilla/RemoteMediaData.h";
     17 [RefCounted] using class mozilla::EncoderConfigurationChangeList from "PlatformEncoderModule.h";
     18 
     19 namespace mozilla {
     20 
     21 union EncodedInputIPDL
     22 {
     23   nullable ArrayOfRemoteAudioData;
     24   nullable ArrayOfRemoteVideoData;
     25 };
     26 
     27 struct EncodeInitCompletionIPDL
     28 {
     29   nsCString description;
     30   bool hardware;
     31   nsCString hardwareReason;
     32 };
     33 
     34 union EncodeInitResultIPDL
     35 {
     36   MediaResult;
     37   EncodeInitCompletionIPDL;
     38 };
     39 
     40 struct EncodeCompletionIPDL
     41 {
     42   nullable ArrayOfRemoteMediaRawData samples;
     43   uint32_t ticketId;
     44 };
     45 
     46 union EncodeResultIPDL
     47 {
     48   MediaResult;
     49   EncodeCompletionIPDL;
     50 };
     51 
     52 // This protocol provides a way to use MediaDataEncoder across processes.
     53 // The parent side currently is only implemented to work with
     54 // RemoteEncoderModule.
     55 // The child side runs in the content process, and the parent side runs
     56 // in the RDD/utility/GPU processes. We run a separate IPDL thread for both
     57 // sides.
     58 [ChildImpl="RemoteMediaDataEncoderChild", ParentImpl="RemoteMediaDataEncoderParent"]
     59 async protocol PRemoteEncoder
     60 {
     61   manager PRemoteMediaManager;
     62 parent:
     63   // Construct must be the first message sent.
     64   async Construct() returns (MediaResult result);
     65 
     66   // Init must only be called after Construct has returned successfully.
     67   async Init() returns (EncodeInitResultIPDL result);
     68 
     69   async Encode(EncodedInputIPDL data) returns (EncodeResultIPDL result);
     70   async Reconfigure(nullable EncoderConfigurationChangeList configurationChanges) returns (MediaResult error);
     71   async Drain() returns (EncodeResultIPDL result);
     72   async ReleaseTicket(uint32_t ticketId);
     73   async Shutdown() returns (bool unused);
     74   async SetBitrate(uint32_t aBitsPerSec) returns (nsresult rv);
     75 
     76   async __delete__();
     77 };
     78 
     79 } // namespace mozilla