这篇教程C++ GST_DEBUG函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GST_DEBUG函数的典型用法代码示例。如果您正苦于以下问题:C++ GST_DEBUG函数的具体用法?C++ GST_DEBUG怎么用?C++ GST_DEBUG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GST_DEBUG函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: accept_socketstatic gint accept_socket (HTTPServer *http_server){ struct epoll_event ee; gint accepted_sock, ret; struct sockaddr in_addr; socklen_t in_len; RequestData **request_data_pointer; RequestData *request_data; gint request_data_queue_len; in_len = sizeof (in_addr); for (;;) { /* repeat accept until -1 returned */ accepted_sock = accept (http_server->listen_sock, &in_addr, &in_len); if (accepted_sock == -1) { if (( errno == EAGAIN) || (errno == EWOULDBLOCK)) { /* We have processed all incoming connections. */ break; } else { GST_ERROR ("accept error %s", g_strerror (errno)); break; } } g_mutex_lock (&(http_server->request_data_queue_mutex)); request_data_queue_len = g_queue_get_length (http_server->request_data_queue); g_mutex_unlock (&(http_server->request_data_queue_mutex)); if (request_data_queue_len == 0) { GST_ERROR ("event queue empty"); (void) close (accepted_sock); //close_socket_gracefully (accepted_sock); continue; } GST_INFO ("request from %s:%d, accepted_sock %d", get_address (in_addr), get_port (in_addr), accepted_sock); http_server->total_click += 1; int on = 1; setsockopt (accepted_sock, SOL_TCP, TCP_CORK, &on, sizeof (on)); set_nonblock (accepted_sock); g_mutex_lock (&(http_server->request_data_queue_mutex)); request_data_pointer = g_queue_pop_tail (http_server->request_data_queue); g_mutex_unlock (&(http_server->request_data_queue_mutex)); if (request_data_pointer == NULL) { GST_WARNING ("No NONE request, refuse this request."); (void) close (accepted_sock); //close_socket_gracefully (accepted_sock); continue; } request_data = *request_data_pointer; GST_DEBUG ("pop up request data, id %d, sock %d, events %d", request_data->id, accepted_sock, request_data->events); /* clear events, there may be events from last request. */ request_data->events = 0; request_data->client_addr = in_addr; request_data->sock = accepted_sock; request_data->birth_time = gst_clock_get_time (http_server->system_clock); request_data->status = HTTP_CONNECTED; request_data->request_length = 0; ee.events = EPOLLIN | EPOLLOUT | EPOLLET; ee.data.ptr = request_data_pointer; ret = epoll_ctl (http_server->epollfd, EPOLL_CTL_ADD, accepted_sock, &ee); if (ret == -1) { GST_ERROR ("epoll_ctl add error %s sock %d", g_strerror (errno), accepted_sock); request_data_release (http_server, request_data_pointer); return -1; } else { GST_DEBUG ("pop request data, sock %d", request_data->sock); } } return 0;}
开发者ID:i4tv,项目名称:gstreamill,代码行数:72,
示例2: gst_date_time_new_from_iso8601_string/** * gst_date_time_new_from_iso8601_string: * @string: ISO 8601-formatted datetime string. * * Tries to parse common variants of ISO-8601 datetime strings into a * #GstDateTime. * * Free-function: gst_date_time_unref * * Returns: (transfer full): a newly created #GstDateTime, or NULL on error */GstDateTime *gst_date_time_new_from_iso8601_string (const gchar * string){ gint year = -1, month = -1, day = -1, hour = -1, minute = -1; gdouble second = -1.0; gfloat tzoffset = 0.0; guint64 usecs; gint len, ret; g_return_val_if_fail (string != NULL, NULL); GST_DEBUG ("Parsing '%s' into a datetime", string); len = strlen (string); if (len < 4 || !g_ascii_isdigit (string[0]) || !g_ascii_isdigit (string[1]) || !g_ascii_isdigit (string[2]) || !g_ascii_isdigit (string[3])) return NULL; ret = sscanf (string, "%04d-%02d-%02d", &year, &month, &day); if (ret == 0) return NULL; if (ret == 3 && day <= 0) { ret = 2; day = -1; } if (ret >= 2 && month <= 0) { ret = 1; month = day = -1; } if (ret >= 1 && year <= 0) return NULL; else if (ret >= 1 && len < 16) /* YMD is 10 chars. XMD + HM will be 16 chars. if it is less, * it make no sense to continue. We will stay with YMD. */ goto ymd; string += 10; /* Exit if there is no expeceted value on this stage */ if (!(*string == 'T' || *string == '-' || *string == ' ')) goto ymd; /* if hour or minute fails, then we will use onlly ymd. */ hour = g_ascii_strtoull (string + 1, (gchar **) & string, 10); if (hour > 24 || *string != ':') goto ymd; /* minute */ minute = g_ascii_strtoull (string + 1, (gchar **) & string, 10); if (minute > 59) goto ymd; /* second */ if (*string == ':') { second = g_ascii_strtoull (string + 1, (gchar **) & string, 10); /* if we fail here, we still can reuse hour and minute. We * will still attempt to parse any timezone information */ if (second > 59) { second = -1.0; } else { /* microseconds */ if (*string == '.' || *string == ',') { const gchar *usec_start = string + 1; guint digits; usecs = g_ascii_strtoull (string + 1, (gchar **) & string, 10); if (usecs != G_MAXUINT64 && string > usec_start) { digits = (guint) (string - usec_start); second += (gdouble) usecs / pow (10.0, digits); } } } } if (*string == 'Z') goto ymd_hms; else { /* reuse some code from gst-plugins-base/gst-libs/gst/tag/gstxmptag.c */ gint gmt_offset_hour = -1, gmt_offset_min = -1, gmt_offset = -1; gchar *plus_pos = NULL; gchar *neg_pos = NULL; gchar *pos = NULL; GST_LOG ("Checking for timezone information");//.........这里部分代码省略.........
开发者ID:PeterXu,项目名称:gst-mobile,代码行数:101,
示例3: flush_datastatic voidflush_data (GstRtpQDM2Depay * depay){ guint i; guint avail; if ((avail = gst_adapter_available (depay->adapter))) gst_adapter_flush (depay->adapter, avail); GST_DEBUG ("Flushing %d packets", depay->nbpackets); for (i = 0; depay->packets[i]; i++) { QDM2Packet *pack = depay->packets[i]; guint32 crc = 0; int i = 0; GstBuffer *buf; guint8 *data; /* CRC is the sum of everything (including first bytes) */ data = pack->data; if (G_UNLIKELY (data == NULL)) continue; /* If the packet size is bigger than 0xff, we need 2 bytes to store the size */ if (depay->packetsize > 0xff) { /* Expanded size 0x02 | 0x80 */ data[0] = 0x82; GST_WRITE_UINT16_BE (data + 1, depay->packetsize - 3); } else { data[0] = 0x2; data[1] = depay->packetsize - 2; } /* Calculate CRC */ for (; i < depay->packetsize; i++) crc += data[i]; GST_DEBUG ("CRC is 0x%x", crc); /* Write CRC */ if (depay->packetsize > 0xff) GST_WRITE_UINT16_BE (data + 3, crc); else GST_WRITE_UINT16_BE (data + 2, crc); GST_MEMDUMP ("Extracted packet", data, depay->packetsize); buf = gst_buffer_new (); gst_buffer_append_memory (buf, gst_memory_new_wrapped (0, data, depay->packetsize, 0, depay->packetsize, data, g_free)); gst_adapter_push (depay->adapter, buf); if (pack->data) { pack->data = NULL; } }}
开发者ID:lubing521,项目名称:gst-embedded-builder,代码行数:61,
示例4: gst_mpg123_audio_dec_class_initstatic voidgst_mpg123_audio_dec_class_init (GstMpg123AudioDecClass * klass){ GstAudioDecoderClass *base_class; GstElementClass *element_class; GstPadTemplate *src_template, *sink_template; int error; GST_DEBUG_CATEGORY_INIT (mpg123_debug, "mpg123", 0, "mpg123 mp3 decoder"); base_class = GST_AUDIO_DECODER_CLASS (klass); element_class = GST_ELEMENT_CLASS (klass); gst_element_class_set_static_metadata (element_class, "mpg123 mp3 decoder", "Codec/Decoder/Audio", "Decodes mp3 streams using the mpg123 library", "Carlos Rafael Giani <[email C++ GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS函数代码示例 C++ GST_CLOCK_TIME_IS_VALID函数代码示例
|