bool CameraBinExposure::setExposureParameter(ExposureParameter parameter, const QVariant& value) { QVariant oldValue = exposureParameter(parameter); switch (parameter) { case QCameraExposureControl::ExposureCompensation: gst_photography_set_ev_compensation(m_session->photography(), value.toReal()); break; case QCameraExposureControl::ISO: gst_photography_set_iso_speed(m_session->photography(), value.toInt()); break; case QCameraExposureControl::Aperture: gst_photography_set_aperture(m_session->photography(), guint(value.toReal()*1000000)); break; case QCameraExposureControl::ShutterSpeed: gst_photography_set_exposure(m_session->photography(), guint(value.toReal()*1000000)); break; default: return false; } QVariant newValue = exposureParameter(parameter); if (!qFuzzyCompare(oldValue.toReal(), newValue.toReal())) emit exposureParameterChanged(parameter); return true; }
void LiningAdjustmentDialog::set_strip_code( guint strip, guint8 code) { Glib::ustring path = Glib::ustring::format(strip); Gtk::TreeModel::iterator iter = liststore_strip_code_->get_iter(path); if (iter) { // Store the user's new text value in the model: Gtk::TreeRow row = *iter; row[model_columns.code] = guint(code); } }
/* key event handler */ gboolean event_key(GtkWidget *widget, GdkEventKey *event, window *w) { guint(g) = event->keyval; if ((event->state & (GDK_CONTROL_MASK|GDK_SHIFT_MASK)) == (GDK_CONTROL_MASK|GDK_SHIFT_MASK)) { if (g == GDK_N) { new_window(); return TRUE; } if (g == GDK_T) { tab_new(w); return TRUE; } if (g == GDK_H) { tab_togglebar(w); return TRUE; } if (g == GDK_W) { tab_close(NULL, w); return TRUE; } if (g == GDK_V) { vte_terminal_paste_clipboard(VTE_TERMINAL(get_current_term(w)->vte)); return TRUE; } if (g == GDK_C) { vte_terminal_copy_clipboard(VTE_TERMINAL(get_current_term(w)->vte)); return TRUE; } } if ((event->state & (GDK_MOD1_MASK) ) == (GDK_MOD1_MASK)) { if (g == GDK_Left) { tab_switch(FALSE, w); return TRUE; } if (g == GDK_Right) { tab_switch(TRUE, w); return TRUE; } if (g == GDK_F11) { if(config->fullscreen) { gtk_window_unfullscreen(GTK_WINDOW(widget)); config->fullscreen = FALSE; } else { gtk_window_fullscreen(GTK_WINDOW(widget)); config->fullscreen = TRUE; } return TRUE; } } return FALSE; }
guint Action::post( Action * action , int interval_ms ) { g_assert( action ); if ( interval_ms < 0 ) { tplog( "POSTING IDLE ACTION %p" , action ); return g_idle_add_full( TRICKPLAY_PRIORITY , ( GSourceFunc ) run_internal , action , destroy ); } tplog( "POSTING TIMEOUT ACTION %p EVERY %d ms" , action , interval_ms ); return g_timeout_add_full( TRICKPLAY_PRIORITY , guint( interval_ms ) , ( GSourceFunc ) run_internal , action , destroy ); }
void ADM_flyDialogGtk::jogRing (void * my_data, gfloat angle) { if (jogRingTimerID) { g_source_remove (jogRingTimerID); jogRingTimerID = 0; } if (angle > -0.0001 && angle < 0.0001) return; jogRingIncr = (angle < 0) ? -1 : +1; angle *= jogRingIncr; // absolute value jogRingTimerID = g_timeout_add (guint ((1 - angle) * 500 + 10), on_jogRingTimer, my_data); }
inline guint8 convert_color_channel (guint8 src, guint8 alpha) { return alpha ? ((guint (src) << 8) - src) / alpha : 0; }
bool CameraBinExposure::setValue(ExposureParameter parameter, const QVariant& value) { QVariant oldValue = actualValue(parameter); switch (parameter) { case QCameraExposureControl::ExposureCompensation: gst_photography_set_ev_compensation(m_session->photography(), value.toReal()); break; case QCameraExposureControl::ISO: gst_photography_set_iso_speed(m_session->photography(), value.toInt()); break; case QCameraExposureControl::Aperture: gst_photography_set_aperture(m_session->photography(), guint(value.toReal()*1000000)); break; case QCameraExposureControl::ShutterSpeed: gst_photography_set_exposure(m_session->photography(), guint(value.toReal()*1000000)); break; case QCameraExposureControl::ExposureMode: { QCameraExposure::ExposureMode mode = QCameraExposure::ExposureMode(value.toInt()); GstSceneMode sceneMode; gst_photography_get_scene_mode(m_session->photography(), &sceneMode); switch (mode) { case QCameraExposure::ExposureManual: sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_MANUAL; break; case QCameraExposure::ExposurePortrait: sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_PORTRAIT; break; case QCameraExposure::ExposureSports: sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_SPORT; break; case QCameraExposure::ExposureNight: sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_NIGHT; break; case QCameraExposure::ExposureAuto: sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_AUTO; break; default: break; } gst_photography_set_scene_mode(m_session->photography(), sceneMode); break; } default: return false; } if (!qFuzzyCompare(m_requestedValues.value(parameter).toReal(), value.toReal())) { m_requestedValues[parameter] = value; emit requestedValueChanged(parameter); } QVariant newValue = actualValue(parameter); if (!qFuzzyCompare(oldValue.toReal(), newValue.toReal())) emit actualValueChanged(parameter); return true; }
void ofxGstRTPServer::update(ofEventArgs & args){ if(ofGetFrameNum()%60==0){ if(videoSSRC!=0 && videoSessionNumber!=guint(-1)){ GObject * internalSession; g_signal_emit_by_name(rtpbin,"get-internal-session",videoSessionNumber,&internalSession,NULL); if(internalSession){ // read all the properties in the internal session /*GParamSpec** properties; guint n_properties; properties = g_object_class_list_properties(G_OBJECT_GET_CLASS(internalSession),&n_properties); for(guint i=0; i<n_properties; i++){ cout << properties[i]->name <<endl; }*/ // get internal session stats useful? perhaps sent packages and bitrate? GObject * internalSource; g_object_get(internalSession,"internal-source",&internalSource, NULL); if(internalSource){ GstStructure *stats; g_object_get (internalSource, "stats", &stats, NULL); //ofLogNotice(LOG_NAME) << gst_structure_to_string(stats); guint64 bitrate; if(stats){ gst_structure_get(stats,"bitrate",G_TYPE_UINT64,&bitrate, NULL); ofLogNotice(LOG_NAME) << "local video bitrate: " << bitrate; } }else{ ofLogError(LOG_NAME) << "couldn't get internal video source"; } }else{ ofLogError() << "couldn't get local video internal session"; } GObject * remoteSource; g_signal_emit_by_name (internalSession, "get-source-by-ssrc", videoSSRC, &remoteSource, NULL); if(remoteSource){ GstStructure *stats; g_object_get (remoteSource, "stats", &stats, NULL); ofLogNotice(LOG_NAME) << gst_structure_to_string(stats); uint rb_round_trip; int rb_packetslost; uint rb_fractionlost; uint rb_jitter; gst_structure_get(stats,"rb-round-trip",G_TYPE_UINT,&rb_round_trip, "rb-packetslost",G_TYPE_INT,&rb_packetslost, "rb-fractionlost",G_TYPE_UINT,&rb_fractionlost, "rb-jitter",G_TYPE_UINT,&rb_jitter, NULL); ofLogNotice(LOG_NAME) << "remote video: round trip:" << rb_round_trip << " packetslost: " << rb_packetslost << " fractionlost: " << rb_fractionlost << " jitter: " << rb_jitter; if(videoPacketsLost<rb_packetslost){ emitVideoKeyFrame(); } videoPacketsLost = rb_packetslost; }else{ ofLogError() << "couldn't get remote stats"; } } if(depthSSRC!=0 && depthSessionNumber!=guint(-1)){ GObject * internalSession; g_signal_emit_by_name(rtpbin,"get-internal-session",depthSessionNumber,&internalSession,NULL); GObject * remoteSource; g_signal_emit_by_name (internalSession, "get-source-by-ssrc", depthSSRC, &remoteSource, NULL); if(internalSession){ // get internal session stats useful? perhaps sent packages and bitrate? GObject * internalSource; g_object_get(internalSession,"internal-source",&internalSource, NULL); if(internalSource){ GstStructure *stats; g_object_get (internalSource, "stats", &stats, NULL); //ofLogNotice(LOG_NAME) << gst_structure_to_string(stats); guint64 bitrate; if(stats){ gst_structure_get(stats,"bitrate",G_TYPE_UINT64,&bitrate, NULL); ofLogNotice(LOG_NAME) << "local depth bitrate: " << bitrate; } }else{ ofLogError(LOG_NAME) << "couldn't get depth internal source"; } }else{ ofLogError() << "couldn't get local depth internal session"; } if(remoteSource){ GstStructure *stats; g_object_get (remoteSource, "stats", &stats, NULL); //ofLogNotice(LOG_NAME) << gst_structure_to_string(stats); uint rb_round_trip; int rb_packetslost; uint rb_fractionlost; uint rb_jitter; gst_structure_get(stats,"rb-round-trip",G_TYPE_UINT,&rb_round_trip, "rb-packetslost",G_TYPE_INT,&rb_packetslost, "rb-fractionlost",G_TYPE_UINT,&rb_fractionlost, "rb-jitter",G_TYPE_UINT,&rb_jitter, NULL); ofLogNotice(LOG_NAME) << "remote audio: round trip:" << rb_round_trip << " packetslost: " << rb_packetslost << " fractionlost: " << rb_fractionlost << " jitter: " << rb_jitter; if(depthPacketsLost<rb_packetslost){ emitDepthKeyFrame(); } depthPacketsLost = rb_packetslost; }else{ ofLogError() << "couldn't get stats"; } } if(audioSSRC!=0 && audioSessionNumber!=guint(-1)){ GObject * internalSession; g_signal_emit_by_name(rtpbin,"get-internal-session",audioSessionNumber,&internalSession,NULL); GObject * remoteSource; g_signal_emit_by_name (internalSession, "get-source-by-ssrc", audioSSRC, &remoteSource, NULL); if(internalSession){ // get internal session stats useful? perhaps sent packages and bitrate? GObject * internalSource; g_object_get(internalSession,"internal-source",&internalSource, NULL); if(internalSource){ GstStructure *stats; g_object_get (internalSource, "stats", &stats, NULL); //ofLogNotice(LOG_NAME) << gst_structure_to_string(stats); guint64 bitrate; if(stats){ gst_structure_get(stats,"bitrate",G_TYPE_UINT64,&bitrate, NULL); ofLogNotice(LOG_NAME) << "local audio bitrate: " << bitrate; } }else{ ofLogError(LOG_NAME) << "couldn't get audio internal source"; } }else{ ofLogError() << "couldn't get local audio internal session"; } if(remoteSource){ GstStructure *stats; g_object_get (remoteSource, "stats", &stats, NULL); //ofLogNotice(LOG_NAME) << gst_structure_to_string(stats); uint rb_round_trip; int rb_packetslost; uint rb_fractionlost; uint rb_jitter; gst_structure_get(stats,"rb-round-trip",G_TYPE_UINT,&rb_round_trip, "rb-packetslost",G_TYPE_INT,&rb_packetslost, "rb-fractionlost",G_TYPE_UINT,&rb_fractionlost, "rb-jitter",G_TYPE_UINT,&rb_jitter, NULL); ofLogNotice(LOG_NAME) << "remote audio: round trip:" << rb_round_trip << " packetslost: " << rb_packetslost << " fractionlost: " << rb_fractionlost << " jitter: " << rb_jitter; }else{ ofLogError() << "couldn't get stats"; } } if(oscSSRC!=0 && oscSessionNumber!=guint(-1)){ GObject * internalSession; g_signal_emit_by_name(rtpbin,"get-internal-session",oscSessionNumber,&internalSession,NULL); if(internalSession){ // get internal session stats useful? perhaps sent packages and bitrate? GObject * internalSource; g_object_get(internalSession,"internal-source",&internalSource, NULL); if(internalSource){ GstStructure *stats; g_object_get (internalSource, "stats", &stats, NULL); //ofLogNotice(LOG_NAME) << gst_structure_to_string(stats); guint64 bitrate; if(stats){ gst_structure_get(stats,"bitrate",G_TYPE_UINT64,&bitrate, NULL); ofLogNotice(LOG_NAME) << "local osc bitrate: " << bitrate; } }else{ ofLogError(LOG_NAME) << "couldn't get internal osc source"; } }else{ ofLogError() << "couldn't get local osc internal session"; } GObject * remoteSource; g_signal_emit_by_name (internalSession, "get-source-by-ssrc", oscSSRC, &remoteSource, NULL); if(remoteSource){ GstStructure *stats; g_object_get (remoteSource, "stats", &stats, NULL); ofLogNotice(LOG_NAME) << gst_structure_to_string(stats); }else{ ofLogError() << "couldn't get stats"; } } } }