Пример #1
0
static void
print_current_tracks (GstPlay * play)
{
  GstPlayerAudioInfo *audio = NULL;
  GstPlayerVideoInfo *video = NULL;
  GstPlayerSubtitleInfo *subtitle = NULL;

  g_print ("Current video track: \n");
  video = gst_player_get_current_video_track (play->player);
  print_video_info (video);

  g_print ("Current audio track: \n");
  audio = gst_player_get_current_audio_track (play->player);
  print_audio_info (audio);

  g_print ("Current subtitle track: \n");
  subtitle = gst_player_get_current_subtitle_track (play->player);
  print_subtitle_info (subtitle);

  if (audio)
    g_object_unref (audio);

  if (video)
    g_object_unref (video);

  if (subtitle)
    g_object_unref (subtitle);
}
Пример #2
0
void xyz_write_video_info(void) {
  const SDL_VideoInfo *vinf;
  FILE *avail_modes, *cur_mode;
  SDL_Rect **modes;

  vinf = SDL_GetVideoInfo();
  cur_mode = fopen("current_mode.txt", "wb");
  if(!cur_mode) xyz_fatal_error("Couldn't write file current_mode.txt!");
  print_video_info(vinf, cur_mode);
  fclose(cur_mode);

  avail_modes = fopen("fullscreen_modes.txt", "wb");
  if(!avail_modes) xyz_fatal_error("Couldn't write file current_mode.txt!");
  modes = SDL_ListModes(vinf->vfmt, SDL_FULLSCREEN|SDL_SWSURFACE);
  print_rectangles(modes, avail_modes);
  fclose(avail_modes);
}
Пример #3
0
static void
print_all_video_stream (GstPlayerMediaInfo * media_info)
{
  GList *list = NULL, *l;

  list = gst_player_get_video_streams (media_info);
  if (!list)
    return;

  g_print ("All video streams\n");
  for (l = list; l != NULL; l = l->next) {
    GstPlayerVideoInfo *info = (GstPlayerVideoInfo *) l->data;
    GstPlayerStreamInfo *sinfo = (GstPlayerStreamInfo *) info;
    g_print (" %s_%d #\n", gst_player_stream_info_get_stream_type (sinfo),
        gst_player_stream_info_get_index (sinfo));
    print_video_info (info);
  }
}
Пример #4
0
static void
print_all_stream_info (GstPlayerMediaInfo * media_info)
{
  guint count = 0;
  GList *list, *l;

  g_print ("URI : %s\n", gst_player_media_info_get_uri (media_info));
  g_print ("Duration: %" GST_TIME_FORMAT "\n",
      GST_TIME_ARGS (gst_player_media_info_get_duration (media_info)));
  g_print ("Global taglist:\n");
  if (gst_player_media_info_get_tags (media_info))
    gst_tag_list_foreach (gst_player_media_info_get_tags (media_info),
        print_one_tag, NULL);
  else
    g_print ("  (nil) \n");

  list = gst_player_media_info_get_stream_list (media_info);
  if (!list)
    return;

  g_print ("All Stream information\n");
  for (l = list; l != NULL; l = l->next) {
    GstTagList *tags = NULL;
    GstPlayerStreamInfo *stream = (GstPlayerStreamInfo *) l->data;

    g_print (" Stream # %u \n", count++);
    g_print ("  type : %s_%u\n",
        gst_player_stream_info_get_stream_type (stream),
        gst_player_stream_info_get_index (stream));
    tags = gst_player_stream_info_get_tags (stream);
    g_print ("  taglist : \n");
    if (tags) {
      gst_tag_list_foreach (tags, print_one_tag, NULL);
    }

    if (GST_IS_PLAYER_VIDEO_INFO (stream))
      print_video_info ((GstPlayerVideoInfo *) stream);
    else if (GST_IS_PLAYER_AUDIO_INFO (stream))
      print_audio_info ((GstPlayerAudioInfo *) stream);
    else
      print_subtitle_info ((GstPlayerSubtitleInfo *) stream);
  }
}
Пример #5
0
// main()
int main(int argc,char *argv[])
{
	char dev_name[32];
	int num_video_devices=0;
	int rc;
	int dev_fd;

	printf("video_scan_main:-----------------------------\n");
	while(1)
	{
		snprintf(dev_name,sizeof(dev_name),"/dev/video%d",num_video_devices);
		dev_fd = open(dev_name,O_RDONLY);
		
		if(dev_fd < 0){
			if(errno == ENOENT)			// No such file or directory
			{
				printf("Video scan is Over! The number of VideoDevice: %d!\n\n",num_video_devices);		
				close(dev_fd);
				break;
			}
			else
			{
				printf("\n!!!Error!!! Video%d: %s!\n",num_video_devices,strerror(errno));
				close(dev_fd);
				num_video_devices++;
				continue;
			}

		}
		else
			print_video_info(dev_fd,num_video_devices);

		close(dev_fd);

		num_video_devices++;
	}


	return 0;
}