<commit_before>#include <stdio.h>
#include <string.h>
#include <gst/gst.h>

#include <gst/vaapi/gstvaapitypes.h>

typedef struct _CustomData
{
  GstElement *pipeline;
  GstElement *video_sink;
  GstElement *src_sink;
  GMainLoop *loop;
  GstPad *src_pad;
  gboolean orient_automatic;
} AppData;

static void
send_rotate_event (AppData * data)
{
  gboolean res = FALSE;
  GstEvent *event;

  event = gst_event_new_tag (gst_tag_list_new (GST_TAG_IMAGE_ORIENTATION,
          "rotate-90", NULL));

  /* Send the event */
  res = gst_pad_push_event (data->src_pad, event);
  g_print ("Sending event %p done: %d\n", event, res);
}

/* Process keyboard input */
static gboolean
handle_keyboard (GIOChannel * source, GIOCondition cond, AppData * data)
{
  gchar *str = NULL;

  if (g_io_channel_read_line (source, &str, NULL, NULL,
          NULL) != G_IO_STATUS_NORMAL) {
    return TRUE;
  }

  switch (g_ascii_tolower (str[0])) {
    case 'r':
      send_rotate_event (data);
      break;
    case 's':{
      g_object_set (G_OBJECT (data->video_sink), "rotation",
          GST_VAAPI_ROTATION_AUTOMATIC, NULL);
      break;<commit_msg>tests: elements: rotate orientation event<commit_after>#include <stdio.h>
#include <string.h>
#include <gst/gst.h>

#include <gst/vaapi/gstvaapitypes.h>

typedef struct _CustomData
{
  GstElement *pipeline;
  GstElement *video_sink;
  GstElement *src_sink;
  GMainLoop *loop;
  GstPad *src_pad;
  gboolean orient_automatic;
} AppData;

static void
send_rotate_event (AppData * data)
{
  gboolean res = FALSE;
  GstEvent *event;
  static gint counter = 0;
  const static gchar *tags[] = { "rotate-90", "rotate-180", "rotate-270",
    "rotate-0"
  };

  event = gst_event_new_tag (gst_tag_list_new (GST_TAG_IMAGE_ORIENTATION,
          tags[counter++ % G_N_ELEMENTS (tags)], NULL));

  /* Send the event */
  res = gst_pad_push_event (data->src_pad, event);
  g_print ("Sending event %p done: %d\n", event, res);
}

/* Process keyboard input */
static gboolean
handle_keyboard (GIOChannel * source, GIOCondition cond, AppData * data)
{
  gchar *str = NULL;

  if (g_io_channel_read_line (source, &str, NULL, NULL,
          NULL) != G_IO_STATUS_NORMAL) {
    return TRUE;
  }

  switch (g_ascii_tolower (str[0])) {
    case 'r':
      send_rotate_event (data);
      break;
    case 's':{
      g_object_set (G_OBJECT (data->video_sink), "rotation",
          GST_VAAPI_ROTATION_AUTOMATIC, NULL);
      break;
{'fraction_non_alphanumeric': 0.12464124641246413, 'fraction_numerical': 0.005740057400574006, 'mean_word_length': 3.7749510763209395, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '949061', 'n_tokens_mistral': 949, 'n_tokens_neox': 925, 'n_words': 211}