Ejemplo n.º 1
0
static int on_libplayer_event(player_event_t e, void *data)
{
	GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[LibPlayerIN] Received event %d\n", e));

  switch (e) {
	case PLAYER_EVENT_PLAYBACK_FINISHED:
	  player_playback_stop(data);
	  player_playback_start(data);
	  if ((in.w && in.h) || (out.w && out.h))
					player_video_io_windows_set(data, &in, &out);
	  break;
    case PLAYER_EVENT_FE_HAS_LOCK:
      break;
    case PLAYER_EVENT_FE_TIMEDOUT:
      break;
    default:
      break;
  }

  return 0;
}
Ejemplo n.º 2
0
static GF_Err LIBPLAYER_Control(GF_PrivateMediaDecoder *dec, Bool mute, GF_Window *src, GF_Window *dst)
{
	GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[LibPlayerDEC] Control\n"));
#ifndef TEST_LIBPLAYER
	//~ video_rect_t in, out;
	LibPlayerIn *read = dec->privateStack;

	if (!read) return GF_OK;

	in.x = src->x;
	in.y = src->y;
	in.w = src->w;
	in.h = src->h;
	out.x = dst->x;
	out.y = dst->y;
	out.w = dst->w;
	out.h = dst->h;
	player_video_io_windows_set(read->player, &in, &out);
#endif

	GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[LibPlayerDEC] Repositioning video src %d %d %d %d - dest %d %d %d %d\n", src->x, src->y, src->w, src->h, dst->x, dst->y, dst->w, dst->h) );
	return GF_OK;
}
Ejemplo n.º 3
0
static GF_Err LIBPLAYER_Control(GF_PrivateMediaDecoder *dec, Bool mute, GF_Window *src, GF_Window *dst)
{
#ifndef TEST_LIBPLAYER
	video_rect_t in, out;
	LibPlayerIn *read = dec->privateStack;
	u32 width, height;

	if (!read) return GF_OK;
	GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[LibPlayerDEC] Control instance %d\n",read->player_id));
	//! unfortunately, saving data would not be a good solution for Mosaic Mode in ESG Application since the position changes everytime user
	//! uses the navigation button
	//~ if (read->player_id == 1 && save_data_instance1 == 1) {
	//~ fprintf(stderr, "in here for save data instance\n");
	//~ player_video_io_windows_set(read->player, &in_instance1, &out_instance1);
	//~
	//~ return GF_OK;
	//~
	//~ } else {
	width = mrl_get_property(read->player, NULL, MRL_PROPERTY_VIDEO_WIDTH);
	height = mrl_get_property(read->player, NULL, MRL_PROPERTY_VIDEO_HEIGHT);
	//~ }



	if((width != read->width) || (height != read->height))	{
		fprintf(stderr, "in here for video size changed\t");
		fprintf(stderr, "width %d read->width %d height %d read->height %d\n", width, read->width, height, read->height);
		GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[LibPlayerDEC] video size changed to width %d - height %d\n", width, height));
		if (width && height) {
			read->width = width;
			read->height = height;
		}
		return GF_BUFFER_TOO_SMALL;
	}

	in.x = src->x;
	in.y = src->y;
	in.w = src->w;
	in.h = src->h;
	out.x = dst->x;
	out.y = dst->y;
	out.w = dst->w;
	out.h = dst->h;
	player_video_io_windows_set(read->player, &in, &out);

	//! unfortunately, saving data would not be a good solution for Mosaic Mode in ESG Application since the position changes everytime user
	//! uses the navigation button
	//~ if (read->player_id == 1) {
	//~ in_instance1 = in;
	//~ //	//~ out_instance1.w = out.w;
	//~ //	//~ out_instance1.h = out.h;
	//~ out_instance1 = out;
	//~ save_data_instance1 = 1;
	//~ }
	//~

#endif

	GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[LibPlayerDEC] Repositioning video src %d %d %d %d - dest %d %d %d %d\n", src->x, src->y, src->w, src->h, dst->x, dst->y, dst->w, dst->h) );
	return GF_OK;
}