summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorEdward Hervey <edward.hervey@collabora.co.uk>2012-05-18 11:10:46 +0200
committerEdward Hervey <edward.hervey@collabora.co.uk>2012-05-18 11:10:46 +0200
commit2c2a8cc79803371568e620a462e6036f6177822e (patch)
treeb63386f988ec1fc64b06b0f72262e4559647b3d1 /ext
parent63f7cdf3198c9bbe70e8c4dd5deb58a4579aca1a (diff)
jpeg: Remove dead code
Diffstat (limited to 'ext')
-rw-r--r--ext/jpeg/gstjpegdec.c88
-rw-r--r--ext/jpeg/gstjpegenc.c14
2 files changed, 0 insertions, 102 deletions
diff --git a/ext/jpeg/gstjpegdec.c b/ext/jpeg/gstjpegdec.c
index a77b58cf0..514c495cf 100644
--- a/ext/jpeg/gstjpegdec.c
+++ b/ext/jpeg/gstjpegdec.c
@@ -303,25 +303,6 @@ gst_jpeg_dec_skip_input_data (j_decompress_ptr cinfo, glong num_bytes)
cinfo->src->next_input_byte += (size_t) num_bytes;
cinfo->src->bytes_in_buffer -= (size_t) num_bytes;
}
-#if 0
- else if (num_bytes > 0) {
- gint available;
-
- num_bytes -= cinfo->src->bytes_in_buffer;
- cinfo->src->next_input_byte += (size_t) cinfo->src->bytes_in_buffer;
- cinfo->src->bytes_in_buffer = 0;
-
- available = gst_adapter_available (dec->adapter);
- if (available < num_bytes || available < dec->rem_img_len) {
- GST_WARNING_OBJECT (dec, "Less bytes to skip than available in the "
- "adapter or the remaining image length %ld < %d or %u",
- num_bytes, available, dec->rem_img_len);
- }
- num_bytes = MIN (MIN (num_bytes, available), dec->rem_img_len);
- gst_adapter_flush (dec->adapter, num_bytes);
- dec->rem_img_len -= num_bytes;
- }
-#endif
}
static boolean
@@ -365,21 +346,6 @@ gst_jpeg_dec_init (GstJpegDec * dec, GstJpegDecClass * class)
{
GST_DEBUG ("initializing");
-#if 0
- /* create the sink and src pads */
- dec->sinkpad =
- gst_pad_new_from_static_template (&gst_jpeg_dec_sink_pad_template,
- "sink");
- gst_element_add_pad (GST_ELEMENT (dec), dec->sinkpad);
- gst_pad_set_setcaps_function (dec->sinkpad,
- GST_DEBUG_FUNCPTR (gst_jpeg_dec_setcaps));
-
- dec->srcpad =
- gst_pad_new_from_static_template (&gst_jpeg_dec_src_pad_template, "src");
- gst_pad_use_fixed_caps (dec->srcpad);
- gst_element_add_pad (GST_ELEMENT (dec), dec->srcpad);
-#endif
-
/* By default, handle non-packetized input. If set_format gets called, we'll
* figure out a better way to handle this
*/
@@ -408,35 +374,6 @@ gst_jpeg_dec_init (GstJpegDec * dec, GstJpegDecClass * class)
dec->max_errors = JPEG_DEFAULT_MAX_ERRORS;
}
-#if 0
-static gboolean
-gst_jpeg_dec_ensure_header (GstJpegDec * dec)
-{
- gint av;
- gint offset;
-
- av = gst_adapter_available (dec->adapter);
- /* we expect at least 4 bytes, first of which start marker */
- offset = gst_adapter_masked_scan_uint32 (dec->adapter, 0xffffff00, 0xffd8ff00,
- 0, av);
- if (G_UNLIKELY (offset < 0)) {
- GST_DEBUG_OBJECT (dec, "No JPEG header in current buffer");
- /* not found */
- if (av > 4)
- gst_adapter_flush (dec->adapter, av - 4);
- return FALSE;
- }
-
- if (offset > 0) {
- GST_LOG_OBJECT (dec, "Skipping %u bytes.", offset);
- gst_adapter_flush (dec->adapter, offset);
- }
- GST_DEBUG_OBJECT (dec, "Found JPEG header");
-
- return TRUE;
-}
-#endif
-
static inline gboolean
gst_jpeg_dec_parse_tag_has_entropy_segment (guint8 tag)
{
@@ -1126,31 +1063,6 @@ gst_jpeg_dec_handle_frame (GstVideoDecoder * bdec, GstVideoCodecFrame * frame)
gint r_h, r_v;
guint code, hdr_ok;
-#if 0
-again:
- if (!gst_jpeg_dec_ensure_header (dec))
- goto need_more_data;
-
- /* If we know that each input buffer contains data
- * for a whole jpeg image (e.g. MJPEG streams), just
- * do some sanity checking instead of parsing all of
- * the jpeg data */
- if (dec->packetized) {
- img_len = gst_adapter_available (dec->adapter);
- } else {
- /* Parse jpeg image to handle jpeg input that
- * is not aligned to buffer boundaries */
- img_len = gst_jpeg_dec_parse_image_data (dec);
-
- if (img_len == 0) {
- goto need_more_data;
- } else if (img_len < 0) {
- gst_adapter_flush (dec->adapter, -img_len);
- goto again;
- }
- }
-#endif
-
dec->current_frame = frame;
gst_jpeg_dec_fill_input_buffer (&dec->cinfo);
diff --git a/ext/jpeg/gstjpegenc.c b/ext/jpeg/gstjpegenc.c
index 9f852e4e8..cf3b2b68e 100644
--- a/ext/jpeg/gstjpegenc.c
+++ b/ext/jpeg/gstjpegenc.c
@@ -238,20 +238,6 @@ gst_jpegenc_term_destination (j_compress_ptr cinfo)
static void
gst_jpegenc_init (GstJpegEnc * jpegenc, GstJpegEncClass * class)
{
-#if 0
- /* create the sink and src pads */
- jpegenc->sinkpad =
- gst_pad_new_from_static_template (&gst_jpegenc_sink_pad_template, "sink");
- gst_pad_set_chain_function (jpegenc->sinkpad,
- GST_DEBUG_FUNCPTR (gst_jpegenc_chain));
- gst_element_add_pad (GST_ELEMENT (jpegenc), jpegenc->sinkpad);
-
- jpegenc->srcpad =
- gst_pad_new_from_static_template (&gst_jpegenc_src_pad_template, "src");
- gst_pad_use_fixed_caps (jpegenc->srcpad);
- gst_element_add_pad (GST_ELEMENT (jpegenc), jpegenc->srcpad);
-#endif
-
/* setup jpeglib */
memset (&jpegenc->cinfo, 0, sizeof (jpegenc->cinfo));
memset (&jpegenc->jerr, 0, sizeof (jpegenc->jerr));