<commit_before>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */

use euclid::Size2D;
use servo_media::player::context::{GlApi, GlContext, NativeDisplay, PlayerGLContext};

/// Helper function that creates a GLPlayer channel (GLPlayerSender,
/// GLPlayerReceiver) to be used in GLPlayerMsg.
pub use crate::media_channel::glplayer_channel;
/// Entry point channel type used for sending GLPlayerMsg messages to
/// the GLPlayer thread.
pub use crate::media_channel::GLPlayerChan;
/// Entry point type used in a Script Pipeline to get the GLPlayerChan
/// to be used in that thread.
pub use crate::media_channel::GLPlayerPipeline;
/// Receiver type used in GLPlayerMsg.
pub use crate::media_channel::GLPlayerReceiver;
/// Result type for send()/recv() calls in in GLPlayerMsg.
pub use crate::media_channel::GLPlayerSendResult;
/// Sender type used in GLPlayerMsg.
pub use crate::media_channel::GLPlayerSender;

/// GLPlayer thread Message API
///
/// These are the message that the thread will receive from the
/// constellation, the webrender::ExternalImageHandle multiplexor
/// implementation, or a htmlmediaelement
#[derive(Debug, Deserialize, Serialize)]
pub enum GLPlayerMsg {
    /// Registers an instantiated player in DOM
    RegisterPlayer(GLPlayerSender<u64>),
    /// Unregisters a player's ID
    UnregisterPlayer(u64),
    /// Locks a specific texture from a player. Lock messages are used
    /// for a correct synchronization with WebRender external image
    /// API.<commit_msg>Add GLPlayerMsgForward enum<commit_after>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */

use euclid::Size2D;
use servo_media::player::context::{GlApi, GlContext, NativeDisplay, PlayerGLContext};

/// Helper function that creates a GLPlayer channel (GLPlayerSender,
/// GLPlayerReceiver) to be used in GLPlayerMsg.
pub use crate::media_channel::glplayer_channel;
/// Entry point channel type used for sending GLPlayerMsg messages to
/// the GLPlayer thread.
pub use crate::media_channel::GLPlayerChan;
/// Entry point type used in a Script Pipeline to get the GLPlayerChan
/// to be used in that thread.
pub use crate::media_channel::GLPlayerPipeline;
/// Receiver type used in GLPlayerMsg.
pub use crate::media_channel::GLPlayerReceiver;
/// Result type for send()/recv() calls in in GLPlayerMsg.
pub use crate::media_channel::GLPlayerSendResult;
/// Sender type used in GLPlayerMsg.
pub use crate::media_channel::GLPlayerSender;

/// These are the messages that the GLPlayer thread will forward to
/// the video player which lives in htmlmediaelement
#[derive(Debug, Deserialize, Serialize)]
pub enum GLPlayerMsgForward {
    PlayerId(u64),
    Lock(GLPlayerSender<(u32, Size2D<i32>, usize)>),
    Unlock(),
}

/// GLPlayer thread Message API
///
/// These are the message that the thread will receive from the
/// constellation, the webrender::ExternalImageHandle multiplexor
/// implementation, or a htmlmediaelement
#[derive(Debug, Deserialize, Serialize)]
pub enum GLPlayerMsg {
    /// Registers an instantiated player in DOM
    RegisterPlayer(GLPlayerSender<GLPlayerMsgForward>),
    /// Unregisters a player's ID
    UnregisterPlayer(u64),
    /// Locks a specific texture from a player. Lock messages are used
    /// for a correct synchronization with WebRender external image
    /// API.
{'fraction_non_alphanumeric': 0.09866962305986696, 'fraction_numerical': 0.006374722838137472, 'mean_word_length': 4.2228654124457305, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6866827', 'n_tokens_mistral': 998, 'n_tokens_neox': 973, 'n_words': 398}