2020-04-15 16:24:10 +03:00
|
|
|
/**
|
|
|
|
|
* RPiPlay - An open-source AirPlay mirroring server for Raspberry Pi
|
|
|
|
|
* Copyright (C) 2019 Florian Draschbacher
|
2023-02-09 08:14:18 -05:00
|
|
|
* Modified for:
|
|
|
|
|
* UxPlay - An open-source AirPlay mirroring server
|
|
|
|
|
* Copyright (C) 2021-23 F. Duncanh
|
2020-04-15 16:24:10 +03:00
|
|
|
*
|
|
|
|
|
* 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 3 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*
|
2021-08-01 13:51:12 -04:00
|
|
|
* H264 renderer using gstreamer
|
2020-04-15 16:24:10 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef VIDEO_RENDERER_H
|
|
|
|
|
#define VIDEO_RENDERER_H
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2021-12-21 23:33:58 -05:00
|
|
|
#include <stdlib.h>
|
2020-04-15 16:24:10 +03:00
|
|
|
#include <stdint.h>
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
#include "../lib/logger.h"
|
|
|
|
|
|
2021-08-02 18:42:22 -04:00
|
|
|
typedef enum videoflip_e {
|
|
|
|
|
NONE,
|
|
|
|
|
LEFT,
|
|
|
|
|
RIGHT,
|
|
|
|
|
INVERT,
|
|
|
|
|
VFLIP,
|
|
|
|
|
HFLIP,
|
|
|
|
|
} videoflip_t;
|
2020-04-15 16:24:10 +03:00
|
|
|
|
|
|
|
|
typedef struct video_renderer_s video_renderer_t;
|
2024-12-10 01:36:32 -05:00
|
|
|
|
2025-12-01 11:44:41 -05:00
|
|
|
void video_renderer_init (logger_t *logger, const char *server_name, videoflip_t videoflip[2], const char *parser, const char *rtp_pipeline,
|
2024-12-10 01:36:32 -05:00
|
|
|
const char *decoder, const char *converter, const char *videosink, const char *videosink_options,
|
2025-08-28 23:01:31 -04:00
|
|
|
bool initial_fullscreen, bool video_sync, bool h265_support, bool coverart_support,
|
|
|
|
|
guint playbin_version, const char *uri);
|
2025-12-01 11:44:41 -05:00
|
|
|
void video_renderer_start ();
|
2021-11-11 06:27:15 -05:00
|
|
|
void video_renderer_stop ();
|
2026-02-04 15:25:45 -05:00
|
|
|
void video_renderer_set_device_model(const char *model, const char *name);
|
|
|
|
|
void video_renderer_set_track_metadata(const char *title, const char *artist, const char *album);
|
2023-09-04 15:12:55 -07:00
|
|
|
void video_renderer_pause ();
|
2025-11-15 14:59:01 -05:00
|
|
|
void video_renderer_hls_ready ();
|
2024-12-10 01:36:32 -05:00
|
|
|
void video_renderer_seek(float position);
|
2025-02-03 08:15:58 -05:00
|
|
|
void video_renderer_set_start(float position);
|
2023-09-04 15:12:55 -07:00
|
|
|
void video_renderer_resume ();
|
2025-09-01 10:37:49 -04:00
|
|
|
int video_renderer_cycle ();
|
2024-12-10 01:36:32 -05:00
|
|
|
bool video_renderer_is_paused();
|
2025-12-01 11:44:41 -05:00
|
|
|
bool video_renderer_eos_watch();
|
2025-04-22 14:42:12 -04:00
|
|
|
uint64_t video_renderer_render_buffer (unsigned char* data, int *data_len, int *nal_count, uint64_t *ntp_time);
|
2025-07-07 20:55:47 -04:00
|
|
|
void video_renderer_display_jpeg(const void *data, int *data_len);
|
2021-11-11 06:27:15 -05:00
|
|
|
void video_renderer_flush ();
|
2024-12-10 01:36:32 -05:00
|
|
|
unsigned int video_renderer_listen(void *loop, int id);
|
2021-11-11 06:27:15 -05:00
|
|
|
void video_renderer_destroy ();
|
2022-01-10 19:08:48 -05:00
|
|
|
void video_renderer_size(float *width_source, float *height_source, float *width, float *height);
|
2024-12-10 01:36:32 -05:00
|
|
|
bool waiting_for_x11_window();
|
2025-12-18 13:08:23 -05:00
|
|
|
bool video_get_playback_info(double *duration, double *position, double *seek_start, double *seek_duration, float *rate, bool *buffer_empty, bool *buffer_full);
|
2025-07-07 20:55:47 -04:00
|
|
|
int video_renderer_choose_codec (bool video_is_jpeg, bool video_is_h265);
|
2024-09-17 18:12:40 -04:00
|
|
|
unsigned int video_renderer_listen(void *loop, int id);
|
2025-12-01 11:44:41 -05:00
|
|
|
bool video_renderer_eos_watch();
|
2020-04-15 16:24:10 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif //VIDEO_RENDERER_H
|
2021-09-13 02:18:06 -04:00
|
|
|
|