
To be able to cast windows, which by definition can change in size dynamically, we need a way to specify the video crop meta to adjust to the window size whenever it changes. Add VideoCrop support with a new optional hook `get_videocrop()` in the `ScreenCastStreamSrcClass` which, if defined, can let the child specify a rectangle for the video cropping area. https://gitlab.gnome.org/GNOME/mutter/merge_requests/306 (cherry picked from commit f64eba57ce3fb67a65a5c5755469d4b97067030f)
60 lines
2.1 KiB
C
60 lines
2.1 KiB
C
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
|
|
/*
|
|
* Copyright (C) 2015-2017 Red Hat Inc.
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License as
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
* License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful, but
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
* 02111-1307, USA.
|
|
*
|
|
*/
|
|
|
|
#ifndef META_SCREEN_CAST_STREAM_SRC_H
|
|
#define META_SCREEN_CAST_STREAM_SRC_H
|
|
|
|
#include <glib-object.h>
|
|
|
|
#include "clutter/clutter.h"
|
|
#include "meta/boxes.h"
|
|
|
|
typedef struct _MetaScreenCastStream MetaScreenCastStream;
|
|
|
|
#define META_TYPE_SCREEN_CAST_STREAM_SRC (meta_screen_cast_stream_src_get_type ())
|
|
G_DECLARE_DERIVABLE_TYPE (MetaScreenCastStreamSrc,
|
|
meta_screen_cast_stream_src,
|
|
META, SCREEN_CAST_STREAM_SRC,
|
|
GObject)
|
|
|
|
struct _MetaScreenCastStreamSrcClass
|
|
{
|
|
GObjectClass parent_class;
|
|
|
|
void (* get_specs) (MetaScreenCastStreamSrc *src,
|
|
int *width,
|
|
int *height,
|
|
float *frame_rate);
|
|
void (* enable) (MetaScreenCastStreamSrc *src);
|
|
void (* disable) (MetaScreenCastStreamSrc *src);
|
|
void (* record_frame) (MetaScreenCastStreamSrc *src,
|
|
uint8_t *data);
|
|
gboolean (* get_videocrop) (MetaScreenCastStreamSrc *src,
|
|
MetaRectangle *crop_rect);
|
|
};
|
|
|
|
void meta_screen_cast_stream_src_maybe_record_frame (MetaScreenCastStreamSrc *src);
|
|
|
|
MetaScreenCastStream * meta_screen_cast_stream_src_get_stream (MetaScreenCastStreamSrc *src);
|
|
|
|
#endif /* META_SCREEN_CAST_STREAM_SRC_H */
|