* @return @c 0 on success. otherwise a negative error value
* @retval #NNS_ERROR_NONE Successful
* @retval #NNS_ERROR_STREAMS_PIPE Pipeline construction is failed because of wrong parameter or initialization failure.
+ * @retval #NNS_ERROR_INVALID_PARAMETER Given parameter is invalid. (pipe is NULL?)
*/
int nns_pipeline_construct (const char *pipeline_description, nns_pipeline_h *pipe);
* @return @c 0 on success. otherwise a negative error value
* @retval #NNS_ERROR_NONE Successful
* @retval #NNS_ERROR_STREAMS_PIPE Failed to start.
+ * @retval #NNS_ERROR_INVALID_PARAMETER Given parameter is invalid. (pipe is NULL?)
*/
int nns_pipeline_start (nns_pipeline_h pipe);
* @return @c 0 on success. otherwise a negative error value
* @retval #NNS_ERROR_NONE Successful
* @retval #NNS_ERROR_STREAMS_PIPE Failed to start.
+ * @retval #NNS_ERROR_INVALID_PARAMETER Given parameter is invalid. (pipe is NULL?)
*/
int nns_pipeline_stop (nns_pipeline_h pipe);
return NNS_ERROR_INVALID_PARAMETER;
}
+ if (!tensors_info) {
+ dloge ("The param nns_tensors_info_s should not be NULL!");
+ return NNS_ERROR_INVALID_PARAMETER;
+ }
+
/** Currently, the data structures of GstTensorsInfo are
* completely same as that of nns_tensors_info_s. */
memcpy (tensors_info, gst_tensorsinfo, sizeof (GstTensorsInfo));
nns_pipeline *pipe_h;
+ if (pipe == NULL)
+ return NNS_ERROR_INVALID_PARAMETER;
+
+ /* init null */
+ *pipe = NULL;
+
if (FALSE == gst_init_check (NULL, NULL, &err)) {
if (err) {
dloge ("GStreamer has the following error: %s", err->message);
GstState _state;
GstState pending;
GstStateChangeReturn scret;
- *state = NNS_PIPELINE_STATE_UNKNOWN;
- if (p == NULL)
+ if (p == NULL || state == NULL)
return NNS_ERROR_INVALID_PARAMETER;
+ *state = NNS_PIPELINE_STATE_UNKNOWN;
+
g_mutex_lock (&p->lock);
scret = gst_element_get_state (p->element, &_state, &pending, 100000UL); /* Do it within 100us! */
g_mutex_unlock (&p->lock);
nns_pipeline *p = pipe;
GstStateChangeReturn scret;
+ if (p == NULL)
+ return NNS_ERROR_INVALID_PARAMETER;
+
g_mutex_lock (&p->lock);
scret = gst_element_set_state (p->element, GST_STATE_PLAYING);
g_mutex_unlock (&p->lock);
nns_pipeline *p = pipe;
GstStateChangeReturn scret;
+ if (p == NULL)
+ return NNS_ERROR_INVALID_PARAMETER;
+
g_mutex_lock (&p->lock);
scret = gst_element_set_state (p->element, GST_STATE_PAUSED);
g_mutex_unlock (&p->lock);
nns_sink *sink;
int ret = NNS_ERROR_NONE;
+ if (h == NULL) {
+ dloge ("The argument sink handle is not valid.");
+ return NNS_ERROR_INVALID_PARAMETER;
+ }
+
+ /* init null */
+ *h = NULL;
+
if (pipe == NULL) {
dloge ("The first argument, pipeline handle is not valid.");
return NNS_ERROR_INVALID_PARAMETER;
}
+ if (sink_name == NULL) {
+ dloge ("The second argument, sink name is not valid.");
+ return NNS_ERROR_INVALID_PARAMETER;
+ }
+
if (cb == NULL) {
dloge ("The callback argument, cb, is not valid.");
return NNS_ERROR_INVALID_PARAMETER;
nns_src *src;
int ret = NNS_ERROR_NONE, i;
+ if (h == NULL) {
+ dloge ("The argument source handle is not valid.");
+ return NNS_ERROR_INVALID_PARAMETER;
+ }
+
+ /* init null */
+ *h = NULL;
+
if (pipe == NULL) {
dloge ("The first argument, pipeline handle is not valid.");
return NNS_ERROR_INVALID_PARAMETER;
}
+ if (src_name == NULL) {
+ dloge ("The second argument, source name is not valid.");
+ return NNS_ERROR_INVALID_PARAMETER;
+ }
+
g_mutex_lock (&p->lock);
elem = g_hash_table_lookup (p->namednodes, src_name);
nns_switch *swtc;
int ret = NNS_ERROR_NONE;
+ if (h == NULL) {
+ dloge ("The argument switch handle is not valid.");
+ return NNS_ERROR_INVALID_PARAMETER;
+ }
+
+ /* init null */
+ *h = NULL;
+
if (pipe == NULL) {
dloge ("The first argument, pipeline handle, is not valid.");
return NNS_ERROR_INVALID_PARAMETER;
handle_init (switch, swtc, h);
+ if (pad_name == NULL) {
+ dloge ("The second argument, pad name, is not valid.");
+ ret = NNS_ERROR_INVALID_PARAMETER;
+ goto unlock_return;
+ }
+
g_object_get (G_OBJECT (elem->element), "active-pad", &active_pad, NULL);
active_name = gst_pad_get_name (active_pad);
handle_init (switch, swtc, h);
+ if (list == NULL) {
+ dloge ("The second argument, list, is not valid.");
+ ret = NNS_ERROR_INVALID_PARAMETER;
+ goto unlock_return;
+ }
+
+ /* init null */
+ *list = NULL;
+
if (elem->type == NNSAPI_SWITCH_INPUT)
it = gst_element_iterate_sink_pads (elem->element);
else if (elem->type == NNSAPI_SWITCH_OUTPUT)
nns_valve *valve;
int ret = NNS_ERROR_NONE;
+ if (h == NULL) {
+ dloge ("The argument valve handle is not valid.");
+ return NNS_ERROR_INVALID_PARAMETER;
+ }
+
+ /* init null */
+ *h = NULL;
+
if (pipe == NULL) {
dloge ("The first argument, pipeline handle, is not valid.");
return NNS_ERROR_INVALID_PARAMETER;