Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 315589 Details for
Bug 460956
Patch(es): fix cheese on systems with more then1 v4l device
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
cheese-2.23.90-cheese_webcam_get_supported_video_formats-shuffle.patch
cheese-2.23.90-cheese_webcam_get_supported_video_formats-shuffle.patch (text/plain), 10.09 KB, created by
Hans de Goede
on 2008-09-02 20:15:48 UTC
(
hide
)
Description:
cheese-2.23.90-cheese_webcam_get_supported_video_formats-shuffle.patch
Filename:
MIME Type:
Creator:
Hans de Goede
Created:
2008-09-02 20:15:48 UTC
Size:
10.09 KB
patch
obsolete
>diff -up cheese-2.23.90/src/cheese-webcam.c.foobar cheese-2.23.90/src/cheese-webcam.c >--- cheese-2.23.90/src/cheese-webcam.c.foobar 2008-09-01 09:37:22.000000000 +0200 >+++ cheese-2.23.90/src/cheese-webcam.c 2008-09-01 10:35:11.000000000 +0200 >@@ -48,6 +48,8 @@ G_DEFINE_TYPE (CheeseWebcam, cheese_webc > > #define CHEESE_WEBCAM_ERROR cheese_webcam_error_quark () > >+static void find_highest_framerate (CheeseVideoFormat *format); >+ > enum CheeseWebcamError > { > CHEESE_WEBCAM_ERROR_UNKNOWN, >@@ -433,6 +435,33 @@ cheese_webcam_get_supported_framerates ( > } > > static void >+cheese_webcam_add_video_format (CheeseWebcamDevice *webcam_device, >+ CheeseVideoFormat *video_format, GstStructure *format_structure) >+{ >+ int i; >+ >+ cheese_webcam_get_supported_framerates (video_format, format_structure); >+ find_highest_framerate (video_format); >+ >+ g_print ("%s %d x %d num_framerates %d\n", video_format->mimetype, video_format->width, >+ video_format->height, video_format->num_framerates); >+ for (i = 0; i < video_format->num_framerates; i++) >+ { >+ g_print ("%d/%d ", video_format->framerates[i].numerator, >+ video_format->framerates[i].denominator); >+ } >+ g_print ("\n"); >+ >+ g_array_append_val (webcam_device->video_formats, *video_format); >+ g_hash_table_insert (webcam_device->supported_resolutions, >+ g_strdup_printf ("%ix%i", video_format->width, >+ video_format->height), >+ GINT_TO_POINTER(webcam_device->num_video_formats + 1)); >+ >+ webcam_device->num_video_formats++; >+} >+ >+static void > cheese_webcam_get_supported_video_formats (CheeseWebcamDevice *webcam_device, GstCaps *caps) > { > int i; >@@ -465,10 +494,7 @@ cheese_webcam_get_supported_video_format > video_format.mimetype = g_strdup (gst_structure_get_name (structure)); > gst_structure_get_int (structure, "width", &(video_format.width)); > gst_structure_get_int (structure, "height", &(video_format.height)); >- cheese_webcam_get_supported_framerates (&video_format, structure); >- >- g_array_append_val (webcam_device->video_formats, video_format); >- webcam_device->num_video_formats++; >+ cheese_webcam_add_video_format(webcam_device, &video_format, structure); > } > else if (GST_VALUE_HOLDS_INT_RANGE (width)) > { >@@ -489,9 +515,7 @@ cheese_webcam_get_supported_video_format > video_format.mimetype = g_strdup (gst_structure_get_name (structure)); > video_format.width = cur_width; > video_format.height = cur_height; >- cheese_webcam_get_supported_framerates (&video_format, structure); >- g_array_append_val (webcam_device->video_formats, video_format); >- webcam_device->num_video_formats++; >+ cheese_webcam_add_video_format(webcam_device, &video_format, structure); > cur_width *= 2; > cur_height *= 2; > } >@@ -505,9 +529,7 @@ cheese_webcam_get_supported_video_format > video_format.mimetype = g_strdup (gst_structure_get_name (structure)); > video_format.width = cur_width; > video_format.height = cur_height; >- cheese_webcam_get_supported_framerates (&video_format, structure); >- g_array_append_val (webcam_device->video_formats, video_format); >- webcam_device->num_video_formats++; >+ cheese_webcam_add_video_format(webcam_device, &video_format, structure); > cur_width /= 2; > cur_height /= 2; > } >@@ -529,7 +551,6 @@ cheese_webcam_get_webcam_device_data (Ch > GstStateChangeReturn ret; > GstMessage *msg; > GstBus *bus; >- int i, j; > > { > pipeline_desc = g_strdup_printf ("%s name=source device=%s ! fakesink", >@@ -564,6 +585,7 @@ cheese_webcam_get_webcam_device_data (Ch > name = "Unknown"; > > g_print ("Detected webcam: %s\n", name); >+ g_print ("device: %s\n", webcam_device->video_device); > pad = gst_element_get_pad (src, "src"); > caps = gst_pad_get_caps (pad); > gst_object_unref (pad); >@@ -578,28 +600,6 @@ cheese_webcam_get_webcam_device_data (Ch > > g_free (pipeline_desc); > } >- >- g_print ("device: %s\n", webcam_device->video_device); >- for (i = 0; i < webcam_device->num_video_formats; i++) >- { >- CheeseVideoFormat video_format; >- >- video_format = g_array_index (webcam_device->video_formats, CheeseVideoFormat, i); >- g_hash_table_insert (webcam_device->supported_resolutions, >- g_strdup_printf ("%ix%i", video_format.width, >- video_format.height), >- &g_array_index (webcam_device->video_formats, >- CheeseVideoFormat, >- i)); >- g_print ("%s %d x %d num_framerates %d\n", video_format.mimetype, video_format.width, >- video_format.height, video_format.num_framerates); >- for (j = 0; j < video_format.num_framerates; j++) >- { >- g_print ("%d/%d ", video_format.framerates[j].numerator, >- video_format.framerates[j].denominator); >- } >- g_print ("\n"); >- } > } > > static void >@@ -639,8 +639,7 @@ cheese_webcam_detect_webcam_devices (Che > } > > static void >-find_highest_framerate (CheeseVideoFormat *format, int *numerator, >- int *denominator) >+find_highest_framerate (CheeseVideoFormat *format) > { > int framerate_numerator; > int framerate_denominator; >@@ -660,8 +659,8 @@ find_highest_framerate (CheeseVideoForma > } > } > >- *numerator = framerate_numerator; >- *denominator = framerate_denominator; >+ format->highest_framerate.numerator = framerate_numerator; >+ format->highest_framerate.denominator = framerate_denominator; > } > > static gboolean >@@ -680,7 +679,6 @@ cheese_webcam_create_webcam_source_bin ( > { > CheeseVideoFormat *format; > int i; >- int framerate_numerator, framerate_denominator; > gchar *resolution; > > /* If we have a matching video device use that one, otherwise use the first */ >@@ -698,9 +696,13 @@ cheese_webcam_create_webcam_source_bin ( > > /* Use the previously set resolution from gconf if it is set and the > * camera supports it. */ >- if (priv->x_resolution != 0 && priv->y_resolution != 0) >- format = g_hash_table_lookup (selected_webcam->supported_resolutions, resolution); >- >+ if (priv->x_resolution != 0 && priv->y_resolution != 0) { >+ i = GPOINTER_TO_INT(g_hash_table_lookup (selected_webcam->supported_resolutions, resolution)); >+ if (i) >+ format = &g_array_index (selected_webcam->video_formats, >+ CheeseVideoFormat, i - 1); >+ } >+ > if (!format) > { > /* Select the highest resolution */ >@@ -723,20 +725,17 @@ cheese_webcam_create_webcam_source_bin ( > if (format == NULL) > goto fallback; > >- find_highest_framerate (format, &framerate_numerator, >- &framerate_denominator); >- > webcam_input = g_strdup_printf ("%s name=video_source device=%s ! capsfilter name=capsfilter caps=video/x-raw-rgb,width=%d,height=%d,framerate=%d/%d;video/x-raw-yuv,width=%d,height=%d,framerate=%d/%d ! identity", > selected_webcam->gstreamer_src, > selected_webcam->video_device, > format->width, > format->height, >- framerate_numerator, >- framerate_denominator, >+ format->highest_framerate.numerator, >+ format->highest_framerate.denominator, > format->width, > format->height, >- framerate_numerator, >- framerate_denominator); >+ format->highest_framerate.numerator, >+ format->highest_framerate.denominator); > g_print ("%s\n", webcam_input); > > priv->webcam_source_bin = gst_parse_bin_from_description (webcam_input, >@@ -1506,10 +1505,6 @@ cheese_webcam_set_video_format (CheeseWe > { > CheeseWebcamPrivate *priv = CHEESE_WEBCAM_GET_PRIVATE (webcam); > GstCaps *new_caps; >- int framerate_numerator; >- int framerate_denominator; >- >- find_highest_framerate (format, &framerate_numerator, &framerate_denominator); > > new_caps = gst_caps_new_simple ("video/x-raw-rgb", > "width", G_TYPE_INT, >@@ -1517,8 +1512,8 @@ cheese_webcam_set_video_format (CheeseWe > "height", G_TYPE_INT, > format->height, > "framerate", GST_TYPE_FRACTION, >- framerate_numerator, >- framerate_denominator, >+ format->highest_framerate.numerator, >+ format->highest_framerate.denominator, > NULL); > gst_caps_append(new_caps, gst_caps_new_simple ("video/x-raw-yuv", > "width", G_TYPE_INT, >@@ -1526,8 +1521,8 @@ cheese_webcam_set_video_format (CheeseWe > "height", G_TYPE_INT, > format->height, > "framerate", GST_TYPE_FRACTION, >- framerate_numerator, >- framerate_denominator, >+ format->highest_framerate.numerator, >+ format->highest_framerate.denominator, > NULL)); > > priv->current_format = format; >diff -up cheese-2.23.90/src/cheese-webcam.h.foobar cheese-2.23.90/src/cheese-webcam.h >--- cheese-2.23.90/src/cheese-webcam.h.foobar 2008-09-01 09:37:18.000000000 +0200 >+++ cheese-2.23.90/src/cheese-webcam.h 2008-09-01 09:38:24.000000000 +0200 >@@ -49,6 +49,7 @@ typedef struct > int height; > int num_framerates; > CheeseFramerate *framerates; >+ CheeseFramerate highest_framerate; > } CheeseVideoFormat; > > typedef struct
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 460956
:
315587
|
315588
| 315589 |
315590
|
315591
|
315592