The call window gains a Camera button that cycles the video source (/dev/video0..3, then the test pattern) through a hook in localui; the status line names the new backend (e.g. video source: v4l2:/dev/video0), and the button is insensitive in --call-demo. The in-call status now says 'in the call - LAN only, no relay', the note the plan asks for. Verified live between two UIs under Xvfb: the Camera button switched the sender from camera to pattern and back, the status line showed the backend, and video kept flowing; screenshots build/mcde-shots/dtchat-t76-camera.png, dtchat-t76b.png, dtchat-t76-video-off.png, dtchat-t76-full.png. Video off, full screen and resize-aware rendering were committed in 4e967b8a3c.
46 lines
1.7 KiB
C
46 lines
1.7 KiB
C
/*
|
|
* ui_call.h -- the call window
|
|
*
|
|
* License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree.
|
|
*/
|
|
#ifndef _Dtchat_ui_call_h
|
|
#define _Dtchat_ui_call_h
|
|
|
|
#include <X11/Intrinsic.h>
|
|
|
|
#include "dc_internal.h"
|
|
|
|
typedef struct DtCallWindow DtCallWindow;
|
|
|
|
/* called when the person hangs up (button or window close) */
|
|
typedef void (*DtCallHangupFn)(void *arg);
|
|
|
|
/*
|
|
* A window for one call: the video area (I420 frames, scaled bilinearly and
|
|
* converted to XRGB), push-to-talk and hang-up. CALL may be NULL for the
|
|
* demo, then PTT and hang-up are insensitive and only frames are shown. The
|
|
* window does not own CALL.
|
|
*/
|
|
DtCallWindow *dtchat_call_window_create(Widget parent, DcMediaCall *call,
|
|
const char *peer_name, DtCallHangupFn hangup, void *arg);
|
|
void dtchat_call_window_destroy(DtCallWindow *window);
|
|
Widget dtchat_call_window_shell(const DtCallWindow *window);
|
|
|
|
/* the newest I420 frame (W x H) to show */
|
|
void dtchat_call_window_set_frame(DtCallWindow *window,
|
|
const unsigned char *i420, int w, int h);
|
|
void dtchat_call_window_set_status(DtCallWindow *window, const char *text);
|
|
int dtchat_call_window_has_frame(const DtCallWindow *window);
|
|
/* push-to-talk state as the button shows it */
|
|
void dtchat_call_window_set_talking(DtCallWindow *window, int on);
|
|
/* an incoming call: the Answer button becomes sensitive and answers with
|
|
* dc_call_accept() */
|
|
void dtchat_call_window_set_incoming(DtCallWindow *window, int incoming);
|
|
/* the Camera button: the hook cycles the source and answers its name, or
|
|
* NULL when there is none; it is called with the window's ARG */
|
|
typedef const char *(*DtCallCameraFn)(void *arg);
|
|
void dtchat_call_window_set_camera_hook(DtCallWindow *window,
|
|
DtCallCameraFn fn, void *arg);
|
|
|
|
#endif /* _Dtchat_ui_call_h */
|