freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

gstfilesrc源文件-資料下載頁

2025-08-21 02:14本頁面
  

【正文】 +%d, offset, (int) readsize)。 /* if the read buffer crosses a mmap region boundary, create a oneoff region */ if ((offset / srcmapsize) != (readend / srcmapsize)) { GST_LOG_OBJECT (src, read buf % G_GUINT64_FORMAT +%d crosses a %dbyte boundary, creating a oneoff, offset, (int) readsize, (int) srcmapsize)。 buf = gst_file_src_map_small_region (src, offset, readsize)。 if (buf == NULL) goto could_not_mmap。 /* otherwise we will create a new mmap region and set it to the default */ } else { gsize mapsize。 off_t nextmap = offset (offset % srcmapsize)。 GST_LOG_OBJECT (src, read buf % G_GUINT64_FORMAT +%d in new mapbuf at % G_GUINT64_FORMAT +%d, mapping and subbuffering, offset, (gint) readsize, (guint64) nextmap, (gint) srcmapsize)。 /* first, we39。re done with the old mapbuf */ gst_buffer_unref (srcmapbuf)。 mapsize = srcmapsize。 /* double the mapsize as long as the readsize is smaller */ while (readsize + offset nextmap + mapsize) { GST_LOG_OBJECT (src, readsize smaller then mapsize %08x %d, (guint) readsize, (gint) mapsize)。 mapsize = 1。 } /* create a new one */ srcmapbuf = gst_file_src_map_region (src, nextmap, mapsize, FALSE)。 if (srcmapbuf == NULL) goto could_not_mmap。 /* subbuffer it */ buf = gst_buffer_create_sub (srcmapbuf, offset nextmap, readsize)。 GST_BUFFER_OFFSET (buf) = GST_BUFFER_OFFSET (srcmapbuf) + offset nextmap。 } } /* if we need to touch the buffer (to bring it into memory), do so */ if (srctouch) { volatile guchar *p = GST_BUFFER_DATA (buf), c。 /* read first byte of each page */ for (i = 0。 i GST_BUFFER_SIZE (buf)。 i += srcpagesize) c = p[i]。 } /* we39。re done, return the buffer */ *buffer = buf。 return GST_FLOW_OK。 /* ERROR */could_not_mmap: { return GST_FLOW_ERROR。 }}endif/*** * read code below * that is to say, you shouldn39。t read the code below, but the code that reads * stuff is below. Well, you shouldn39。t not read the code below, feel free * to read it of course. It39。s just that read code below is a pretty crappy * documentation string because it sounds like we39。re expecting you to read * the code to understand what it does, which, while true, is really not * the sort of attitude we want to be advertising. No sir. * */static GstFlowReturngst_file_src_create_read (GstFileSrc * src, guint64 offset, guint length, GstBuffer ** buffer){ int ret。 GstBuffer *buf。 if (G_UNLIKELY (srcread_position != offset)) { off_t res。 res = lseek (srcfd, offset, SEEK_SET)。 if (G_UNLIKELY (res 0 || res != offset)) goto seek_failed。 srcread_position = offset。 } buf = gst_buffer_try_new_and_alloc (length)。 if (G_UNLIKELY (buf == NULL amp。amp。 length 0)) { GST_ERROR_OBJECT (src, Failed to allocate %u bytes, length)。 return GST_FLOW_ERROR。 } GST_LOG_OBJECT (src, Reading %d bytes at offset 0x% G_GINT64_MODIFIER x, length, offset)。 ret = read (srcfd, GST_BUFFER_DATA (buf), length)。 if (G_UNLIKELY (ret 0)) goto could_not_read。 /* seekable regular files should have given us what we expected */ if (G_UNLIKELY ((guint) ret length amp。amp。 srcseekable)) goto unexpected_eos。 /* other files should eos if they read 0 and more was requested */ if (G_UNLIKELY (ret == 0 amp。amp。 length 0)) goto eos。 length = ret。 GST_BUFFER_SIZE (buf) = length。 GST_BUFFER_OFFSET (buf) = offset。 GST_BUFFER_OFFSET_END (buf) = offset + length。 *buffer = buf。 srcread_position += length。 return GST_FLOW_OK。 /* ERROR */seek_failed: { GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL), GST_ERROR_SYSTEM)。 return GST_FLOW_ERROR。 }could_not_read: { GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL), GST_ERROR_SYSTEM)。 gst_buffer_unref (buf)。 return GST_FLOW_ERROR。 }unexpected_eos: { GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL), (unexpected end of file.))。 gst_buffer_unref (buf)。 return GST_FLOW_ERROR。 }eos: { GST_DEBUG (nonregular file hits EOS)。 gst_buffer_unref (buf)。 return GST_FLOW_UNEXPECTED。 }}static GstFlowReturngst_file_src_create (GstBaseSrc * basesrc, guint64 offset, guint length, GstBuffer ** buffer){ GstFileSrc *src。 GstFlowReturn ret。 src = GST_FILE_SRC (basesrc)。ifdef HAVE_MMAP if (srcusing_mmap) { ret = gst_file_src_create_mmap (src, offset, length, buffer)。 } else { ret = gst_file_src_create_read (src, offset, length, buffer)。 }else ret = gst_file_src_create_read (src, offset, length, buffer)。endif return ret。}static gbooleangst_file_src_query (GstBaseSrc * basesrc, GstQuery * query){ gboolean ret = FALSE。 GstFileSrc *src = GST_FILE_SRC (basesrc)。 switch (GST_QUERY_TYPE (query)) { case GST_QUERY_URI: gst_query_set_uri (query, srcuri)。 ret = TRUE。 break。 default: ret = FALSE。 break。 } if (!ret) ret = GST_BASE_SRC_CLASS (parent_class)query (basesrc, query)。 return ret。}static gbooleangst_file_src_is_seekable (GstBaseSrc * basesrc){ GstFileSrc *src = GST_FILE_SRC (basesrc)。 return srcseekable。}static gbooleangst_file_src_get_size (GstBaseSrc * basesrc, guint64 * size){ struct stat stat_results。 GstFileSrc *src。 src = GST_FILE_SRC (basesrc)。 if (!srcseekable) { /* If it isn39。t seekable, we won39。t know the length (but fstat will still * succeed, and wrongly say our length is zero. */ return FALSE。 }
點擊復(fù)制文檔內(nèi)容
黨政相關(guān)相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1