From: Jacek Anaszewski <j.anaszewski@samsung.com>
To: linux-media@vger.kernel.org
Cc: m.chehab@samsung.com, gjasny@googlemail.com, hdegoede@redhat.com,
hans.verkuil@cisco.com, b.zolnierkie@samsung.com,
sakari.ailus@linux.intel.com, kyungmin.park@samsung.com,
Jacek Anaszewski <j.anaszewski@samsung.com>
Subject: [v4l-utils RFC v3 10/11] mediactl: Close only pipeline sub-devices
Date: Thu, 06 Nov 2014 11:11:41 +0100 [thread overview]
Message-ID: <1415268702-23685-11-git-send-email-j.anaszewski@samsung.com> (raw)
In-Reply-To: <1415268702-23685-1-git-send-email-j.anaszewski@samsung.com>
The function media_device_new_by_entity_devname queries
media devices available in the system for containment
if given media entity. If a verification is negative
the media_device is released with media_device_unref.
In the previous approach media_device_unref was closing
all media entities it contained, which was undesirable
behavior as there might exist other initialized plugins
which had opened the same media_device and initialized
a pipeline. With this patch only the sub-devices that
belong to the pipeline of current media_device instance
will be closed.
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
---
utils/media-ctl/libmediactl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/utils/media-ctl/libmediactl.c b/utils/media-ctl/libmediactl.c
index 75021e7..fe38270 100644
--- a/utils/media-ctl/libmediactl.c
+++ b/utils/media-ctl/libmediactl.c
@@ -919,13 +919,13 @@ void media_device_unref(struct media_device *media)
if (media->refcount > 0)
return;
+ media_close_pipeline_subdevs(media);
+
for (i = 0; i < media->entities_count; ++i) {
struct media_entity *entity = &media->entities[i];
free(entity->pads);
free(entity->links);
- if (entity->fd != -1)
- close(entity->fd);
}
free(media->entities);
--
1.7.9.5
next prev parent reply other threads:[~2014-11-06 10:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-06 10:11 [v4l-utils RFC v3 00/11] Add a plugin for the Exynos4 camera Jacek Anaszewski
2014-11-06 10:11 ` [v4l-utils RFC v3 01/11] mediactl: Introduce ctrl_to_subdev configuration Jacek Anaszewski
2014-11-06 12:20 ` Sakari Ailus
2014-11-06 10:11 ` [v4l-utils RFC v3 02/11] mediactl: Separate entity and pad parsing Jacek Anaszewski
2014-11-06 10:11 ` [v4l-utils RFC v3 03/11] mediatext: Add library Jacek Anaszewski
2014-11-06 10:11 ` [v4l-utils RFC v3 04/11] mediactl: Add media device graph helpers Jacek Anaszewski
2014-11-06 10:11 ` [v4l-utils RFC v3 05/11] mediactl: Add media_device creation helpers Jacek Anaszewski
2014-11-06 10:11 ` [v4l-utils RFC v3 06/11] mediactl: Add subdev_fmt property to the media_entity Jacek Anaszewski
2014-11-06 10:11 ` [v4l-utils RFC v3 07/11] mediactl: Add VYUY8_2X8 media bus format Jacek Anaszewski
2014-11-06 10:11 ` [v4l-utils RFC v3 08/11] mediactl: Add support for media device pipelines Jacek Anaszewski
2014-11-06 10:11 ` [v4l-utils RFC v3 09/11] mediactl: Add media device ioctl API Jacek Anaszewski
2014-11-06 10:11 ` Jacek Anaszewski [this message]
2014-11-06 10:11 ` [v4l-utils RFC v3 11/11] Add a libv4l plugin for Exynos4 camera Jacek Anaszewski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1415268702-23685-11-git-send-email-j.anaszewski@samsung.com \
--to=j.anaszewski@samsung.com \
--cc=b.zolnierkie@samsung.com \
--cc=gjasny@googlemail.com \
--cc=hans.verkuil@cisco.com \
--cc=hdegoede@redhat.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-media@vger.kernel.org \
--cc=m.chehab@samsung.com \
--cc=sakari.ailus@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox