WO2018094813A1 - 媒体扫描与播放的控制方法、装置及智能设备 - Google Patents
媒体扫描与播放的控制方法、装置及智能设备 Download PDFInfo
- Publication number
- WO2018094813A1 WO2018094813A1 PCT/CN2016/112863 CN2016112863W WO2018094813A1 WO 2018094813 A1 WO2018094813 A1 WO 2018094813A1 CN 2016112863 W CN2016112863 W CN 2016112863W WO 2018094813 A1 WO2018094813 A1 WO 2018094813A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- media
- scanning
- service
- playing
- scan
- Prior art date
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/432—Content retrieval operation from a local storage medium, e.g. hard-disk
- H04N21/4325—Content retrieval operation from a local storage medium, e.g. hard-disk by playing back content from the storage medium
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/433—Content storage operation, e.g. storage operation in response to a pause request, caching operations
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/442—Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
- H04N21/44204—Monitoring of content usage, e.g. the number of times a movie has been viewed, copied or the amount which has been watched
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/47—End-user applications
- H04N21/472—End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
- H04N21/47202—End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content for requesting content on demand, e.g. video on demand
Definitions
- the present invention relates to the field of multimedia playback technologies, and in particular, to a method, device, and smart device for controlling media scanning and playing.
- the existing video player due to the integration of 4K ultra-high definition and high resolution, causes the video file to occupy a large memory of the player when loading, which affects the quality and smoothness of the source.
- the main purpose of the present invention is to provide a control method for media scanning and playing, which aims to solve the technical problem of preempting memory resources and video jam caused by simultaneous operation of media scanning and video playing.
- the present invention provides a method for controlling media scanning and playback, the control method comprising the following steps:
- Get the playback status of the media player broadcast the notification media scan service to continue scanning or pause scanning.
- the method further includes:
- the step of acquiring the access operation of the external storage and/or the access operation of the media center, and the step of broadcasting the notification to the media scanning service to perform the scanning task specifically includes:
- the step of acquiring the scanning process of the media scanning service and updating the media display on the media center page in real time includes:
- the step of acquiring the playing state of the media player, and broadcasting the notification that the media scanning service continues to scan or pause the scanning includes:
- the playing state is pause or stop, it is determined whether the media scanning is completed, and if so, the media scanning process is ended, and if not, the media scanning process is continued;
- the playing state is playing, determining whether the media scanning is completed, and if yes, ending the media scanning process; if not, obtaining the ratio of the current media playing and the media scanning to the system memory, and determining whether the ratio exceeds a preset threshold, if , the media scanning process is suspended, and if not, the media playback and media scanning processes are continued.
- Another object of the present invention is to provide a control device for media scanning and playback, the control device comprising:
- the media scanning startup module acquires an access operation of the external storage and/or an access operation of the media center, and broadcasts the notification media scanning service to perform a scanning task;
- the media display module obtains the scanning process of the media scanning service and updates the media display on the media center page in real time;
- the media playing module obtains a click play operation performed on the media center page, and controls the media player to perform playing;
- the media scan control module obtains the play status of the media player, and the broadcast informs the media scan service to continue scanning or pause scanning.
- control device further includes:
- Registration module Registration media scanning service and broadcast notification service.
- media scan startup module includes:
- Scanning the notification unit to control the broadcast notification service to send a scan notification to the media scanning service when the media center is opened and/or the external storage is mounted;
- the first determining unit determines whether the media scanning service has been started, and if not, starts the media scanning service
- the task obtaining unit acquires a path of the media to be scanned in the media center and/or the external storage, and adds the task list set to the media scanning service.
- the media display module includes:
- a second determining unit determining whether the media scanning process needs to be suspended, and if yes, performing the media scanning process after the media scanning process is paused for a preset time; if not, continuing the media scanning process;
- the page displays the update unit, adds real-time scan results to the database, and updates to the media center page for display.
- the media scan control module includes:
- a third determining unit determining a playing state of the media player that sends the customized broadcast
- the playing state is pause or stop, it is determined whether the media scanning is completed, and if so, the media scanning process is ended, and if not, the media scanning process is continued.
- the playing state is playing, determining whether the media scanning is completed, and if yes, ending the media scanning process; if not, obtaining the ratio of the current media playing and the media scanning to the system memory, and determining whether the ratio exceeds a preset threshold, if , the media scanning process is suspended, and if not, media playback and media scanning are continued.
- the present invention also proposes a smart device comprising control means for media scanning and playback as described above.
- the smart device is a smart TV, a smart phone, a PC, a smart speaker, or a smart projector.
- the method for controlling media scanning and playing according to the present invention is applied to a smart device capable of performing media scanning and media playing, and the system broadcasts a notification media when acquiring an access operation with external storage and/or an operation of entering a media center.
- the scanning service performs a media scanning task, and then updates the media display on the media center page in real time according to the scanning process of the obtained media scanning service, and then controls the media player to click on the clicked playback operation on the media center page.
- the selected media file is played, and finally, according to the obtained playing state of the media player, the media scanning service is sent a broadcast notification to continue scanning or pause scanning, which solves the problem that the media scanning and the video playing preempt the memory resource and the video playing card. Improve the smoothness of media scanning and media playback.
- FIG. 1 is a flowchart of an embodiment of a method for controlling media scanning and playing according to the present invention
- step S20 in FIG. 1 is a specific flowchart of step S20 in FIG. 1;
- step S30 in FIG. 1 is a specific flowchart of step S30 in FIG. 1;
- step S50 in FIG. 1 is a specific flowchart of step S50 in FIG. 1;
- FIG. 5 is a functional block diagram of an embodiment of a media scanning and playing control device according to the present invention.
- FIG. 6 is a schematic structural diagram of a media scanning startup module in FIG. 5;
- FIG. 7 is a schematic structural diagram of a media display module in FIG. 5;
- FIG. 8 is a schematic structural diagram of the media scan control module of FIG. 5.
- Label name Label name 100 Media scanning and playback control device 31 Second judgment unit 10 Registration module 32 Page display update unit 20 Media scan startup module 40 Media player module twenty one Scan notification unit 50 Media scan control module twenty two First judgment unit 51 Custom broadcast sending unit twenty three Task acquisition unit 52 Third judgment unit 30 Media display module
- the invention provides a method for controlling media scanning and playing.
- FIG. 1 is a flowchart of an embodiment of a method for controlling media scanning and playing according to the present invention.
- the method for controlling media scanning and playing includes the following steps:
- S20 Acquire an access operation of the external storage and/or an access operation of the media center, and broadcast a notification to the media scanning service to perform a scanning task;
- S40 Acquire a click play operation performed on the media center page, and control the media player to perform play;
- S50 Acquire the playing status of the media player, and the broadcast notifies the media scanning service to continue scanning or pause scanning.
- the media scanning and playing control method is mainly used for a smart device with a media scanning and media playing function, and a general smart device will have its own media center or external storage device when it leaves the factory, and
- the internal application or service broadcast notification, or the function of sending a broadcast notification to the outside, that is, the system of the smart device is accompanied by a media scanning service and a broadcast notification service, and some smart devices do not have the above-mentioned media scanning service and broadcast notification service at the time of shipment.
- it is necessary to register a media scanning service and a broadcast notification service so that the smart device can read the files of the internal media center and the external storage device accessed.
- the system automatically obtains the access operation of the external storage and/or the access operation of the media center, and after the preliminary analysis, creates a scan for the external storage, Or the media center, or simultaneously scanning the external storage and media center instructions, and transmitting to the media scanning service through the broadcast notification service, and the media scanning service performs scanning of the external storage and/or media center after receiving the scanning instruction. task.
- the media files after the scanning is completed will be released in time, displayed on the media center page, and the scanning process of the media scanning service can obtain real-time data of the scanned media files.
- the real-time update on the display page of the media center enables the user to view relevant media information in time, which is convenient for the user to perform the selection operation.
- the user can also close the media scanning service after seeing the required media file information, thereby reducing the use of system memory.
- the rate is to ensure that the system is smooth and does not appear to be stuck when viewing the required media files, which increases the efficiency and speed of the user viewing the media files.
- the user can select the corresponding media file according to the needs, and double-click or click to implement the playback.
- the system obtains the double-click or click-click operation performed by the user, the system
- the corresponding media player is matched according to the type of the media file to perform the corresponding play task, for example, the file player is automatically loaded for the files in the formats of rmvb, MP4, csf, mkv, etc.
- the file of the same format automatically loads the audio player or the video player to perform the playing task, and automatically loads the picture player for the files in the formats of jpg, jpeg, gif, png, bmp, etc. to perform the playing task.
- the media player During the operation of the media player, the media player has a large difference in the proportion of the system memory due to whether the media player performs the play task. In order to avoid the occurrence of a jam when the media file is played, or the media scan is stuck, the system will obtain the media player in real time. The playback status is then notified by the broadcast media to continue scanning or pausing the scan to ensure that the system memory is occupied within a preset threshold range, ensuring the smoothness of media playback and media scanning.
- the system broadcasts a notification to the media scanning service to perform a media scanning task, and then according to the obtained
- the scanning process of the media scanning service updates the media display on the media center page in real time, and then controls the media player to play the selected media file when the click-to-play operation is performed on the media center page, and finally according to the obtained
- the playback state of the media player sends a broadcast notification to the media scanning service to continue scanning or pause scanning, which solves the problem of media scanning and video playback preempting memory resources and video playing, and improves the smoothness of media scanning and media playback.
- the step S20 specifically includes:
- S23 Obtain a path of the media to be scanned in the media center and/or the external storage, and add the task list set to the media scanning service.
- the system acquires the above operation and sends an instruction to the broadcast notification service to instruct the Sending a scan notification to the media scan service.
- the system first performs a detection test of whether the media scan service has started running. When it is determined that the media scan service has not started running, the system controls its startup operation. After the media scan service has started running, set its scan thread execution priority to 1, giving it a higher execution priority. The lower the value corresponding to the execution priority, the higher the priority level is, and the more frequently it is executed.
- the system obtains the path of the medium to be scanned in the media center or the external storage, or obtains the path of the medium to be scanned in the media center and the external storage, and obtains the path of the medium to be scanned in the external mount. , also need to determine whether the external storage mount has a switch limit to remind the user to open and open The switch that limits the external storage mount is convenient for the system to scan and read. After the system obtains the path of the to-be-scanned media, it adds it to the task list set of the media scan service, in order to further improve the user to view the required media file.
- the system will count the type of media file that the user first clicks to play in the media file that is scanned in the media center or external storage mount, and then according to the statistical probability to the media scan service task list set
- the scanning tasks are prioritized so that the media files that the user most needs to view first are first scanned by the media scanning service and displayed on the media center page.
- step S30 specifically includes:
- S31 determining whether it is necessary to pause the media scanning process, and if yes, performing the media scanning process after the media scanning process is paused for a preset time, and if not, continuing the media scanning process;
- the media scan task after the path of the media to be scanned in the media center and/or the external storage is acquired, and the media scan task list set is formed, the media scan task generally starts scanning the target media file according to the task list set.
- the needStop flag of the media scan needs to suspend the scanning, that is, whether the media scanning process needs to be suspended, the needStop is The flag of the media scan service, which determines the running status of the media scan service.
- the system mainly sends a broadcast notification to change its status. When the system detects that the system memory has occupied a certain proportion, the media scan service will continue to run and exceed the system memory.
- the system will broadcast the notification that needStop is changed to the pause state, pause the media scanning process, and the media scanning service enters the pause state.
- the preset time is paused, it is judged again whether the scanning needs to be suspended, and if so, the pause is continued.
- the preset time of the pause is generally set to about 1 second. In other embodiments, the preset time may be set according to the actual situation. If the media scan service continues to run, the system memory usage ratio is still within the preset threshold range.
- the broadcast notification needsStop changed to continue scanning state, continue the media scanning process, after performing the above two scanning logics, delete the original data in the same path to release more storage space, reduce system memory pressure, in order to make the user more Quickly view the required media files, the system will add the scan results to the database in real time, to further update to the media center page for display, so that users can click and view in time.
- the step S50 specifically includes:
- S51 Acquire a play, pause, or stop operation performed on the media player, and send the message to the media scan service through a custom broadcast;
- S52 Determine a play status of the media player that sends the custom broadcast.
- step S521 is performed, and if so, step S522 is performed, and if no, step S523 is performed;
- step S521 is performed, if yes, step S522 is performed, if not, step S524 is performed, and if yes, step S525 is performed, and if no, step S526 is performed;
- S524 Obtain a ratio of the current media play and the media scan to the system memory, and determine whether the ratio exceeds a preset threshold;
- the media player After the media player receives the broadcast notification for performing the play, the media player is initialized, and then the play, pause, or stop event is started, and the system acquires the play and pause performed on the media player. Or stop the operation, create a custom broadcast to send to the media scan service, the custom broadcast carries the playback state of the media player to play, pause, or stop, and sometimes it is also possible to create a separate broadcast control receiver to receive the portable media.
- the custom broadcast of the playing state of the player determines the playing state of the media player carried by the media scanning service after receiving the customized broadcast. If the playing state is paused or stopped, it is determined whether the media scanning is completed. If yes, the media scanning process is ended.
- the needStop flag is changed to continue scanning, and the media scanning process is continued. If the playing state is playing, it is determined whether the media scanning is completed, and if so, the media scanning process is ended. To reduce the memory usage of the system, if not, obtain the current media Play with the media scanning accounting system memory ratio to determine whether the ratio exceeds a preset threshold, and if so, change needStop flag to pause a scan state, suspend the media scan process, if not, continue to the media player and the media scanning process.
- the invention further provides a control device for media scanning and playing.
- FIG. 5 is a functional block diagram of an embodiment of a media scanning and playback control apparatus according to the present invention.
- the media scanning and playing control device 100 includes:
- the media scan startup module 20 acquires an access operation of the external storage and/or an entry operation of the media center, and broadcasts the notification media scan service to perform a scan task;
- the media display module 30 obtains a scanning process of the media scanning service, and updates the media display on the media center page in real time;
- the media playing module 40 acquires a click play operation performed on the media center page, and controls the media player to perform playing;
- the media scan control module 50 obtains the play status of the media player, and the broadcast informs the media scan service to continue scanning or pause scanning.
- the media scanning and playing control device 100 includes a media scan activation module 20, a media display module 30, a media playback module 40, and a media scan control module 50.
- the user opens the media center or inserts on the smart device.
- the media scan startup module 20 automatically acquires the access operation of the external storage and/or the access operation of the media center, and after the preliminary analysis, creates a scan for the external storage, or the media center, or simultaneously scans.
- the external storage and media center instructions are sent to the media scanning service through the broadcast notification service, and the media scanning service performs the task of scanning the external storage and/or media center after receiving the scanning instruction.
- the media files after the scanning is completed are released in time and displayed on the media center page, and the media scanning module 30 obtains the scanning process of the media scanning service to obtain the completed scanned media files.
- the real-time data is updated in real time on the display page of the media center, which enables the user to view the relevant media information in time, so that the user can perform the selection operation, and the user can also close the media scanning service after seeing the required media file information, and then Reduce the memory usage of the system to ensure that the system is smooth and does not appear to be stuck when viewing the required media files, which increases the efficiency and speed of the user viewing the media files.
- the user can select the corresponding media file according to the need, double-click or click to implement the play, and the media play module 40 obtains the double-click or click-click play operation performed by the user.
- the corresponding play task is performed, for example, the file player is automatically loaded for the file in the format of rmvb, MP4, csf, mkv, etc. to perform the play task, for the MP3.
- the files in the format of wma, wav, au, etc. automatically load the audio player or the video player to perform the playing task, and automatically load the picture player for the files in the formats of jpg, jpeg, gif, png, bmp, etc. to perform the playing task.
- the media scan control module 50 may be in real time. Obtain the playing status of the media player, and then notify the media scanning service to continue scanning or pause scanning by sending a broadcast to ensure that the system memory is occupied within a preset threshold range, thereby ensuring the smoothness of media playback and media scanning.
- the media scanning and playing control device 100 of the present embodiment broadcasts the notification media scanning service to perform a media scanning task when the media scanning activation module 20 acquires an external storage access operation and/or an operation of entering the media center.
- the media display module 30 obtains the scanning process of the media scanning service, updates the media display on the media center page in real time, and then controls the media player to select the click by the media playing module 40 when the click-to-play operation is obtained on the media center page.
- the media file is played, and finally the media scan control module 50 obtains the play status of the media player, sends a broadcast notification to the media scan service to continue scanning or pauses the scan, and solves the problem of media scan and video play preempting memory resources and video play.
- the problem has improved the fluency of media scanning and media playback.
- control apparatus 100 further includes:
- the registration module 10 registers a media scan service and a broadcast notification service.
- the media scanning and playing control device 100 is mainly used for a smart device with a media scanning and media playing function, and a general smart device will have its own media center or external storage device when it leaves the factory, and The function of broadcasting a notification to an internal application or service, or sending a broadcast notification to the outside, that is, the system of the smart device is accompanied by a media scanning service and a broadcast notification service, and some smart devices do not have the above-mentioned media scanning service and broadcast notification at the time of shipment.
- the service at this time, requires the registration module 10 to register a media scanning service and a broadcast notification service so that the smart device can read the files of the internal media center and the external storage devices accessed.
- the media scan startup module 20 includes:
- the scan notification unit 21 controls the broadcast notification service to send a scan notification to the media scan service when the media center is opened and/or the external storage is mounted;
- the first determining unit 22 determines whether the media scanning service has been started, and if not, starts the media scanning service, and if so, sets the scanning thread execution priority to 1;
- the task obtaining unit 23 acquires a path of the media to be scanned in the media center and/or the external storage, and adds the task list set to the media scanning service.
- the media scan activation module 20 includes a scan notification unit 21, a determination unit 22, and a task acquisition unit 23, and inserts an external device when the user opens the media center or inserts an external storage mount, or the user opens the media center.
- the scan notification unit 21 acquires the above operation and sends an instruction to the broadcast notification service to instruct it to send a scan notification to the media scan service.
- the judgment unit 22 first executes a media scan service. Whether the detection judgment of the running has been started, when it is determined that the media scanning service has not started running, control its startup operation, and after determining that the media scanning service has started running, set its scanning thread execution priority to 1, giving it a higher execution.
- the task acquisition unit 23 obtains the path of the medium to be scanned in the media center or the external storage mount, or simultaneously Obtain the path of the media to be scanned in the media center and external storage, and obtain the task in the task.
- the source 23 obtains the path of the medium to be scanned in the external mount, it is also necessary to determine whether the external storage mount has a switch limit, to remind the user to open the switch with the external storage mount with the switch restriction, so that the system can scan and After the system obtains the path of the to-be-scanned media, it adds it to the task list of the media scanning service.
- the system will count each time in the media center or external storage.
- the user In the media file that is scanned in the load, the user first clicks on the type of the media file to be played, and then prioritizes the scan tasks in the task list set of the media scan service according to the statistical probability, so that the user needs to view the first view.
- the media file is first scanned by the media scanning service and displayed on the media center page.
- the media display module 30 includes:
- the second determining unit 31 determines whether it is necessary to pause the media scanning process, and if yes, after the media scanning process is paused for a preset time, the media scanning process is executed, and if not, the media scanning process is continued;
- the page display update unit 32 adds the real-time scan result to the database and updates to the media center page for display.
- the media display module 30 includes a second determining unit 31 and a page display updating unit 32.
- the task obtaining unit 23 obtains a path of the medium to be scanned in the media center and/or the external storage to form a media scan task list. After the set, the media scan task generally starts scanning the target media file according to the task list set, but in order to further ensure the smoothness of the system operation and the fluency of the media scanning process, the media scan is first performed by the second
- the determining unit 31 determines whether the needStop flag of the media scan needs to suspend scanning, that is, whether it is necessary to pause the media scanning process, and the needStop is a flag bit of the media scanning service, and the flag bit can determine the running state of the media scanning service, mainly by the system.
- the second determining unit 31 detects that the system memory has occupied a certain proportion and the media scanning service continues to run, the preset threshold range of the system memory occupancy ratio is exceeded, and the second determining unit 31 broadcasts a notification to the needStop.
- Change to pause, pause the media the media scanning service enters a pause state, and after a preset timeout, it is determined again whether it is necessary to pause the scanning. If yes, the media scanning process is continued to be suspended until the media scanning process is no longer suspended, and the preset time of the pause is generally It is set to about 1 second. In other embodiments, it can be set separately according to the actual situation.
- the broadcast notification needsStop is changed to continue scanning state.
- the broadcast notification needsStop is changed to continue scanning state.
- the file, page display update unit 32 will add the scan result to the database in real time to further update to the media center page for display, so that the user can click and view in time.
- the media scan control module 50 includes:
- the custom broadcast sending unit 51 acquires a play, pause, or stop operation performed on the media player, and sends the message to the media scan service through a custom broadcast;
- the third determining unit 52 determines the playing status of the media player that sends the customized broadcast
- the playing state is pause or stop, it is determined whether the media scanning is completed, and if so, the media scanning process is ended, and if not, the media scanning process is continued;
- the playing state is playing, determining whether the media scanning is completed, and if yes, ending the media scanning process; if not, obtaining the ratio of the current media playing and the media scanning to the system memory, and determining whether the ratio exceeds a preset threshold, if , the media scanning process is suspended, and if not, the media playback and media scanning processes are continued.
- the media scan control module 50 includes a custom broadcast sending unit 51 and a play loading determining unit 52.
- the media player After the media player receives the broadcast notification for performing the play, the media player is initialized and then executed. Playing, pausing, or stopping the event, the custom broadcast transmitting unit 51 acquires a play, pause, or stop operation performed on the media player, and creates a custom broadcast to be sent to the media scan service, the custom broadcast carries the playback of the media player The status is played, paused, or stopped. Sometimes a broadcast control receiver may be separately created to receive a custom broadcast carrying the playback status of the media player. After the media scan service receives the custom broadcast, the third judgment is performed. The unit 52 determines the playing status of the media player that it carries.
- the playing status is paused or stopped, it determines whether the media scanning is completed. If yes, the media scanning process ends. If not, the needStop flag is changed to continue scanning. Continue the media scanning process if the playing state is playing Then, it is determined whether the media scan is completed. If yes, the media scan process is ended to reduce the system memory usage. If not, the ratio of the current media play and the media scan to the system memory is obtained, and the ratio is determined to exceed a preset threshold. If yes, Then, the needStop flag is changed to pause the scanning state, and the media scanning process is suspended. If not, the media playback and media scanning processes are continued.
- the present invention also provides a smart device comprising the media scanning and playing control device 100 as described above, the smart device being a smart TV, a smart phone, a PC, a smart speaker, or a smart projector.
- the smart device may be a smart TV, a smart phone, a PC, a smart speaker, or a smart projector, and the smart device includes the above-mentioned media scanning and playing control device 100, and the media scanning and playing control device 100 includes a media scan activation module 20, a media display module 30, a media playback module 40, and a media scan control module 50.
- the media scan startup module 20 acquires the external device.
- the broadcast notification media scanning service performs the media scanning task
- the media display module 30 acquires the scanning process of the media scanning service, and updates the media display on the media center page in real time, and then
- the media player module 40 controls the media player to play the selected media file
- the media scan control module 50 obtains the playing state of the media player and scans the media.
- Send a broadcast to inform them to continue scanning or pause scanning Must scan the media with the video player to seize the issue of memory resources and video player Caton improve the fluency of media scanning and media playback.
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Human Computer Interaction (AREA)
- Computer Networks & Wireless Communication (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
- Computer And Data Communications (AREA)
Abstract
本发明公开一种媒体扫描与播放的控制方法、装置及智能设备,在获取到有外置存储的接入操作和/或进入媒体中心的操作时,系统会广播通知媒体扫描服务执行媒体扫描任务,然后依据获取到的媒体扫描服务的扫描进程,实时更新媒体中心页面上的媒体显示,接着在获取到媒体中心页面上有点击播放的操作时,控制媒体播放器对点击选择的媒体文件进行播放,最后根据获取到的媒体播放器的播放状态,向媒体扫描服务发送广播通知其继续扫描或暂停扫描,解决了媒体扫描与视频播放抢占内存资源和视频播放卡顿的问题,提高了媒体扫描与媒体播放的流畅性。
Description
技术领域
本发明涉及多媒体播放技术领域,尤其涉及一种媒体扫描与播放的控制方法、装置及智能设备。
背景技术
现有的视频播放器,由于4K超高清、高分辨率的融入,导致视频文件加载时占用播放器内存较大,影响片源画质和流畅性。
目前,智能电视通过U盘或硬盘等外置存储设备观看本地视频已成为不可缺少的部分,本地播放不会受到网络带宽和视频服务器的影响,不会出现因缓冲而产生的画面卡顿现象,但是如果插入的外置存储设备分区多、文件多,扫描需要一段比较长的时间,而扫描的同时用户开始观看已经扫描完成的4K视频时,会出现视频卡顿现象,尤其在低配内存的智能电视上,媒体扫描和视频播放会出现抢占内存资源的情况。
发明内容
本发明的主要目的在于提供一种媒体扫描与播放的控制方法,旨在解决媒体扫描与视频播放同时运行造成的抢占内存资源以及视频卡顿的技术问题。
为实现上述目的,本发明提出一种媒体扫描与播放的控制方法,该控制方法包括以下步骤:
获取外置存储的接入操作和/或媒体中心的进入操作,广播通知媒体扫描服务执行扫描任务;
获取媒体扫描服务的扫描进程,实时更新媒体中心页面上的媒体显示;
获取在媒体中心页面上执行的点击播放操作,控制媒体播放器执行播放;
获取媒体播放器的播放状态,广播通知媒体扫描服务继续扫描或暂停扫描。
进一步地,所述获取外置存储的接入操作和/或媒体中心的进入操作,广播通知媒体扫描服务执行扫描任务的步骤之前,还包括:
注册媒体扫描服务和广播通知服务。
进一步地,所述获取外置存储的接入操作和/或媒体中心的进入操作,广播通知媒体扫描服务执行扫描任务的步骤,具体包括:
在打开媒体中心和/或外置存储挂载时,控制广播通知服务向媒体扫描服务发送扫描通知;
判断媒体扫描服务是否已经启动,若否,则启动媒体扫描服务;
获取媒体中心和/或外置存储内待扫描媒体的路径,添加到媒体扫描服务的任务列表集。
进一步地,所述获取媒体扫描服务的扫描进程,实时更新媒体中心页面上的媒体显示的步骤,具体包括:
判断是否需要暂停媒体扫描进程,若是,则将所述媒体扫描进程暂停预设时间后,执行所述媒体扫描进程,若否,则继续所述媒体扫描进程;
添加实时扫描结果至数据库,更新至媒体中心页面进行显示。
进一步地,所述获取媒体播放器的播放状态,广播通知媒体扫描服务继续扫描或暂停扫描的步骤,具体包括:
获取对媒体播放器执行的播放、暂停、或停止操作,通过自定义广播发送至媒体扫描服务;
判断发送所述自定义广播的媒体播放器的播放状态;
若所述播放状态为暂停或停止,则判断媒体扫描是否完成,若是,则结束媒体扫描进程,若否,则继续所述媒体扫描进程;
若所述播放状态为播放,则判断媒体扫描是否完成,若是,则结束媒体扫描进程,若否,则获取当前媒体播放与媒体扫描占系统内存的比例,判断该比例是否超过预设阈值,若是,则暂停所述媒体扫描进程,若否,则继续媒体播放和媒体扫描进程。
本发明的另一目的在于提供一种媒体扫描与播放的控制装置,该控制装置包括:
媒体扫描启动模块,获取外置存储的接入操作和/或媒体中心的进入操作,广播通知媒体扫描服务执行扫描任务;
媒体显示模块,获取媒体扫描服务的扫描进程,实时更新媒体中心页面上的媒体显示;
媒体播放模块,获取在媒体中心页面上执行的点击播放操作,控制媒体播放器执行播放;
媒体扫描控制模块,获取媒体播放器的播放状态,广播通知媒体扫描服务继续扫描或暂停扫描。
进一步地,该控制装置还包括:
注册模块,注册媒体扫描服务和广播通知服务。
进一步地,所述媒体扫描启动模块包括:
扫描通知单元,在打开媒体中心和/或外置存储挂载时,控制广播通知服务向媒体扫描服务发送扫描通知;
第一判断单元,判断媒体扫描服务是否已经启动,若否,则启动媒体扫描服务;
任务获取单元,获取媒体中心和/或外置存储内待扫描媒体的路径,添加到媒体扫描服务的任务列表集。
进一步地,所述媒体显示模块包括:
第二判断单元,判断是否需要暂停媒体扫描进程,若是,则将所述媒体扫描进程暂停预设时间后,执行所述媒体扫描进程,若否,则继续所述媒体扫描进程;
页面显示更新单元,添加实时扫描结果至数据库,更新至媒体中心页面进行显示。
进一步地,所述媒体扫描控制模块包括:
自定义广播发送单元,获取对媒体播放器执行的播放、暂停、或停止操作,通过自定义广播发送至媒体扫描服务;
第三判断单元,判断发送所述自定义广播的媒体播放器的播放状态,
若所述播放状态为暂停或停止,则判断媒体扫描是否完成,若是,则结束媒体扫描进程,若否,则继续所述媒体扫描进程,
若所述播放状态为播放,则判断媒体扫描是否完成,若是,则结束媒体扫描进程,若否,则获取当前媒体播放与媒体扫描占系统内存的比例,判断该比例是否超过预设阈值,若是,则暂停所述媒体扫描进程,若否,则继续媒体播放和媒体扫描。
本发明还提出一种智能设备,该智能设备包括如上所述的媒体扫描与播放的控制装置。
进一步地,所述智能设备为智能电视、智能手机、PC、智能音箱、或智能投影仪。
本发明的媒体扫描与播放的控制方法,应用于能够进行媒体扫描和媒体播放的智能设备,在获取到有外置存储的接入操作和/或进入媒体中心的操作时,系统会广播通知媒体扫描服务执行媒体扫描任务,然后依据获取到的媒体扫描服务的扫描进程,实时更新媒体中心页面上的媒体显示,接着在获取到媒体中心页面上有点击播放的操作时,控制媒体播放器对点击选择的媒体文件进行播放,最后根据获取到的媒体播放器的播放状态,向媒体扫描服务发送广播通知其继续扫描或暂停扫描,解决了媒体扫描与视频播放抢占内存资源和视频播放卡顿的问题,提高了媒体扫描与媒体播放的流畅性。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图示出的结构获得其他的附图。
图1为本发明的媒体扫描与播放的控制方法一实施例的流程图;
图2为图1中步骤S20的具体流程图;
图3为图1中步骤S30的具体流程图;
图4为图1中步骤S50的具体流程图;
图5为本发明的媒体扫描与播放的控制装置一实施例的功能模块图;
图6为图5中媒体扫描启动模块的结构示意图;
图7为图5中媒体显示模块的结构示意图;
图8为图5中媒体扫描控制模块的结构示意图。
附图标号说明:
标号 | 名称 | 标号 | 名称 |
100 | 媒体扫描与播放的控制装置 | 31 | 第二判断单元 |
10 | 注册模块 | 32 | 页面显示更新单元 |
20 | 媒体扫描启动模块 | 40 | 媒体播放模块 |
21 | 扫描通知单元 | 50 | 媒体扫描控制模块 |
22 | 第一判断单元 | 51 | 自定义广播发送单元 |
23 | 任务获取单元 | 52 | 第三判断单元 |
30 | 媒体显示模块 |
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本发明。
本发明提供一种媒体扫描与播放的控制方法。
参照图1,图1为本发明媒体扫描与播放的控制方法一实施例的流程图。
在本实施例中,该媒体扫描与播放的控制方法,包括以下步骤:
S10:注册媒体扫描服务和广播通知服务;
S20:获取外置存储的接入操作和/或媒体中心的进入操作,广播通知媒体扫描服务执行扫描任务;
S30:获取媒体扫描服务的扫描进程,实时更新媒体中心页面上的媒体显示;
S40:获取在媒体中心页面上执行的点击播放操作,控制媒体播放器执行播放;
S50:获取媒体播放器的播放状态,广播通知媒体扫描服务继续扫描或暂停扫描。
在本实施例中,该媒体扫描与播放的控制方法主要用于附带媒体扫描和媒体播放功能的智能设备,一般的智能设备在出厂时都会具备读取自身媒体中心或外置存储设备,并向内部应用程序或服务广播通知,或向外部发送广播通知的功能,也即智能设备的系统附带有媒体扫描服务和广播通知服务,也有些智能设备在出厂时不具备上述媒体扫描服务和广播通知服务,这时就需要先注册一个媒体扫描服务和广播通知服务,以便该智能设备能够读取内部媒体中心的文件,以及接入的外置存储设备。
在用户打开媒体中心或在智能设备上插入外置存储设备时,系统会自动获取所述外置存储的接入操作和/或媒体中心的进入操作,初步分析后创建一扫描该外置存储、或媒体中心、或同时扫描该外置存储和媒体中心的指令,并通过广播通知服务发送至媒体扫描服务,媒体扫描服务收到上述扫描指令后执行扫描所述外置存储和/或媒体中心的任务。
在媒体扫描服务的运行过程中,经过其扫描完成后的媒体文件会及时释放出来,在媒体中心页面上予以显示,获取媒体扫描服务的扫描进程能够得到已完成扫描的媒体文件的实时数据,将其实时更新在媒体中心的显示页面上,能够使得用户及时查看相关的媒体信息,便于用户进行选择操作,用户还可以在看到需要的媒体文件信息后关闭媒体扫描服务,进而降低系统内存的使用率,以保证查看所需媒体文件时系统流畅、不会出现卡顿的情形,增加了用户查看媒体文件的高效性和快捷性。
在媒体中心页面显示出已完成扫描的媒体文件后,用户可以根据需要选择相应的媒体文件,双击或单击操作实现播放,在系统获取到用户执行的双击或单击的点击播放操作时,系统会根据媒体文件的类型匹配相应的媒体播放器执行相应的播放任务,如针对rmvb、MP4、csf、mkv等格式的文件自动加载视频播放器来执行该播放任务,对MP3、wma、wav、au等格式的文件自动加载音频播放器或视频播放器来执行该播放任务,对jpg、jpeg、gif、png、bmp等格式的文件自动加载图片播放器来执行该播放任务。
在媒体播放器运行过程中,由于媒体播放器是否执行播放任务对系统内存的占用比例差别较大,为了避免媒体文件播放时产生卡顿,或媒体扫描出现卡死,系统会实时获取媒体播放器的播放状态,然后通过发送广播通知媒体扫描服务继续扫描或暂停扫描,以保证系统内存的占用在预设的阈值范围内,保证媒体播放和媒体扫描的流畅性。
本实施例的媒体扫描与播放的控制方法,在获取到有外置存储的接入操作和/或进入媒体中心的操作时,系统会广播通知媒体扫描服务执行媒体扫描任务,然后依据获取到的媒体扫描服务的扫描进程,实时更新媒体中心页面上的媒体显示,接着在获取到媒体中心页面上有点击播放的操作时,控制媒体播放器对点击选择的媒体文件进行播放,最后根据获取到的媒体播放器的播放状态,向媒体扫描服务发送广播通知其继续扫描或暂停扫描,解决了媒体扫描与视频播放抢占内存资源和视频播放卡顿的问题,提高了媒体扫描与媒体播放的流畅性。
进一步地,参照图2,基于上述实施例的媒体扫描与播放的控制方法,步骤S20具体包括:
S21:在打开媒体中心和/或外置存储挂载时,控制广播通知服务向媒体扫描服务发送扫描通知;
S22:判断媒体扫描服务是否已经启动,若否,则启动媒体扫描服务,若是,则设置扫描线程执行优先权为1;
S23:获取媒体中心和/或外置存储内待扫描媒体的路径,添加到媒体扫描服务的任务列表集。
在本实施例中,在用户打开媒体中心或插入外置存储挂载,或用户打开媒体中心的同时插入外置存储挂载时,系统会获取到上述操作并向广播通知服务发送指令,指示其向媒体扫描服务发送扫描通知,在所述扫描服务发出之后,系统首先会执行一个媒体扫描服务是否已启动运行的检测判断,在确定媒体扫描服务还未启动运行时,控制其启动运行,在确定媒体扫描服务已经启动运行后,设置其扫描线程执行优先权为1,赋予其较高的执行优先权,执行优先权对应的数值越低,代表其具有越高的优先权等级,执行越频繁,接着系统会获取媒体中心或外置存储挂载内待扫描媒体的路径,或同时获取媒体中心和外置存储挂载内待扫描媒体的路径,在获取外置挂载内待扫描媒体的路径之前,还需要判断该外置存储挂载是否存在开关限制,以提醒用户打开具备开关限制的外置存储挂载的开关,方便系统进行扫描和读取,系统获取上述待扫描媒体的路径后,将其添加至媒体扫描服务的任务列表集中,为了进一步提高用户查看所需媒体文件的速度,系统会统计每次在媒体中心或外置存储挂载内完成扫描的媒体文件中,用户最先点击播放的媒体文件的类型,然后依据统计概率对媒体扫描服务的任务列表集内的扫描任务进行优先级的排序,以使得用户最需要首先查看的媒体文件最先被媒体扫描服务扫描释放,显示在媒体中心页面上。
进一步地,参照图3,基于上述实施例的媒体扫描与播放的控制方法,步骤S30具体包括:
S31:判断是否需要暂停媒体扫描进程,若是,则将所述媒体扫描进程暂停预设时间后,执行所述媒体扫描进程,若否,则继续所述媒体扫描进程;
S32:添加实时扫描结果至数据库,更新至媒体中心页面进行显示。
在本实施例中,在获取到媒体中心和/或外置存储内待扫描媒体的路径,形成媒体扫描任务列表集之后,媒体扫描任务一般就依据所述任务列表集开始对目标媒体文件进行扫描,但是为了进一步保证系统运行的流畅性以及媒体扫描进程的流畅性,在执行媒体扫描之前,会首先判断媒体扫描的needStop标志是否需要暂停扫描,也即是否需要暂停媒体扫描进程,所述needStop为媒体扫描服务的标志位,该标志位能够决定媒体扫描服务的运行状态,主要由系统发送广播通知更改其状态,在系统检测到系统内存已经占用一定比例,媒体扫描服务继续运行时会超过系统内存占用比的预设阈值范围,则系统会广播通知needStop更改为暂停状态,暂停媒体扫描进程,媒体扫描服务进入暂停状态,在暂停预设时间之后再次判断是否需要暂停扫描,如果是,则继续暂停,直至不再需要暂停扫描,暂停的预设时间一般设置在1秒左右,在其他实施例中,可以根据实际情况另行设定,如果媒体扫描服务继续运行时系统内存占用比仍处于预设的阈值范围内,则广播通知needStop更改为继续扫描状态,继续媒体扫描进程,在执行上述两种扫描逻辑后,删除相同路径下的原始数据,以释放更多的存储空间,减少系统内存压力,为了使用户更快地查看到所需的媒体文件,系统会实时添加扫描结果至数据库,以进一步更新至媒体中心页面进行显示,方便用户及时点击查看。
进一步地,参照图4,基于上述实施例的媒体扫描与播放的控制方法,步骤S50具体包括:
S51:获取对媒体播放器执行的播放、暂停、或停止操作,通过自定义广播发送至媒体扫描服务;
S52:判断发送所述自定义广播的媒体播放器的播放状态;
若所述播放状态为暂停或停止,则执行步骤S521,若是,则执行步骤S522,若否,则执行步骤S523;
若所述播放状态为播放,则执行步骤S521,若是,则执行步骤S522,若否,则执行步骤S524,若是,则执行步骤S525,若否,则执行步骤S526;
S521:判断媒体扫描是否完成;
S522:结束媒体扫描进程;
S523:继续所述媒体扫描进程;
S524:获取当前媒体播放与媒体扫描占系统内存的比例,判断该比例是否超过预设阈值;
S525:暂停所述媒体扫描进程;
S526:继续媒体播放和媒体扫描进程。
在本实施例中,在媒体播放器收到执行播放的广播通知后,先对该媒体播放器进行初始化,然后开始执行播放、暂停、或停止事件,系统获取对媒体播放器执行的播放、暂停、或停止操作,创建一个自定义广播发送至媒体扫描服务,该自定义广播携带媒体播放器的播放状态播放、暂停、或停止,有时还可能单独创建一个广播控制接收器,来专门接收携带媒体播放器的播放状态的自定义广播,在媒体扫描服务接收到该自定义广播后,判断其携带的媒体播放器的播放状态,若所述播放状态为暂停或停止,则判断媒体扫描是否完成,若是,则结束媒体扫描进程,若否,则更改needStop标志为继续扫描状态,继续所述媒体扫描进程,若所述播放状态为播放,则判断媒体扫描是否完成,若是,则结束媒体扫描进程,以减少系统内存的占用,若否,则获取当前媒体播放与媒体扫描占系统内存的比例,判断该比例是否超过预设阈值,若是,则更改needStop标志为暂停扫描状态,暂停所述媒体扫描进程,若否,则继续媒体播放和媒体扫描进程。
本发明进一步提供一种媒体扫描与播放的控制装置。
参照图5,图5为本发明的媒体扫描与播放的控制装置一实施例的功能模块图。
在本实施例中,该媒体扫描与播放的控制装置100包括:
媒体扫描启动模块20,获取外置存储的接入操作和/或媒体中心的进入操作,广播通知媒体扫描服务执行扫描任务;
媒体显示模块30,获取媒体扫描服务的扫描进程,实时更新媒体中心页面上的媒体显示;
媒体播放模块40,获取在媒体中心页面上执行的点击播放操作,控制媒体播放器执行播放;
媒体扫描控制模块50,获取媒体播放器的播放状态,广播通知媒体扫描服务继续扫描或暂停扫描。
在本实施例中,该媒体扫描与播放的控制装置100包括媒体扫描启动模块20、媒体显示模块30、媒体播放模块40、及媒体扫描控制模块50,在用户打开媒体中心或在智能设备上插入外置存储设备时,媒体扫描启动模块20会自动获取所述外置存储的接入操作和/或媒体中心的进入操作,初步分析后创建一扫描该外置存储、或媒体中心、或同时扫描该外置存储和媒体中心的指令,并通过广播通知服务发送至媒体扫描服务,媒体扫描服务收到上述扫描指令后执行扫描所述外置存储和/或媒体中心的任务。
在媒体扫描服务的运行过程中,经过其扫描完成后的媒体文件会及时释放出来,在媒体中心页面上予以显示,由媒体显示模块30获取媒体扫描服务的扫描进程能够得到已完成扫描的媒体文件的实时数据,将其实时更新在媒体中心的显示页面上,能够使得用户及时查看相关的媒体信息,便于用户进行选择操作,用户还可以在看到需要的媒体文件信息后关闭媒体扫描服务,进而降低系统内存的使用率,以保证查看所需媒体文件时系统流畅、不会出现卡顿的情形,增加了用户查看媒体文件的高效性和快捷性。
在媒体中心页面显示出已完成扫描的媒体文件后,用户可以根据需要选择相应的媒体文件,双击或单击操作实现播放,在媒体播放模块40获取到用户执行的双击或单击的点击播放操作时,媒体播放模块40会根据媒体文件的类型匹配相应的媒体播放器执行相应的播放任务,如针对rmvb、MP4、csf、mkv等格式的文件自动加载视频播放器来执行该播放任务,对MP3、wma、wav、au等格式的文件自动加载音频播放器或视频播放器来执行该播放任务,对jpg、jpeg、gif、png、bmp等格式的文件自动加载图片播放器来执行该播放任务。
在媒体播放器运行过程中,由于媒体播放器是否执行播放任务对系统内存的占用比例差别较大,为了避免媒体文件播放时产生卡顿,或媒体扫描出现卡死,媒体扫描控制模块50会实时获取媒体播放器的播放状态,然后通过发送广播通知媒体扫描服务继续扫描或暂停扫描,以保证系统内存的占用在预设的阈值范围内,保证媒体播放和媒体扫描的流畅性。
本实施例的媒体扫描与播放的控制装置100,在媒体扫描启动模块20获取到有外置存储的接入操作和/或进入媒体中心的操作时,广播通知媒体扫描服务执行媒体扫描任务,然后由媒体显示模块30获取媒体扫描服务的扫描进程,实时更新媒体中心页面上的媒体显示,接着在获取到媒体中心页面上有点击播放的操作时,由媒体播放模块40控制媒体播放器对点击选择的媒体文件进行播放,最后由媒体扫描控制模块50获取媒体播放器的播放状态,向媒体扫描服务发送广播通知其继续扫描或暂停扫描,解决了媒体扫描与视频播放抢占内存资源和视频播放卡顿的问题,提高了媒体扫描与媒体播放的流畅性。
进一步地,参照图5,该控制装置100还包括:
注册模块10,注册媒体扫描服务和广播通知服务。
在本实施例中,该媒体扫描与播放的控制装置100主要用于附带媒体扫描和媒体播放功能的智能设备,一般的智能设备在出厂时都会具备读取自身媒体中心或外置存储设备,并向内部应用程序或服务广播通知,或向外部发送广播通知的功能,也即智能设备的系统附带有媒体扫描服务和广播通知服务,也有些智能设备在出厂时不具备上述媒体扫描服务和广播通知服务,这时就需要注册模块10注册一个媒体扫描服务和广播通知服务,以便该智能设备能够读取内部媒体中心的文件,以及接入的外置存储设备。
进一步地,参照图6,媒体扫描启动模块20包括:
扫描通知单元21,在打开媒体中心和/或外置存储挂载时,控制广播通知服务向媒体扫描服务发送扫描通知;
第一判断单元22,判断媒体扫描服务是否已经启动,若否,则启动媒体扫描服务,若是,则设置扫描线程执行优先权为1;
任务获取单元23,获取媒体中心和/或外置存储内待扫描媒体的路径,添加到媒体扫描服务的任务列表集。
在本实施例中,媒体扫描启动模块20包括扫描通知单元21、判断单元22、及任务获取单元23,在用户打开媒体中心或插入外置存储挂载,或用户打开媒体中心的同时插入外置存储挂载时,扫描通知单元21会获取到上述操作并向广播通知服务发送指令,指示其向媒体扫描服务发送扫描通知,在所述扫描服务发出之后,判断单元22首先会执行一个媒体扫描服务是否已启动运行的检测判断,在确定媒体扫描服务还未启动运行时,控制其启动运行,在确定媒体扫描服务已经启动运行后,设置其扫描线程执行优先权为1,赋予其较高的执行优先权,执行优先权对应的数值越低,代表其具有越高的优先权等级,执行越频繁,接着任务获取单元23会获取媒体中心或外置存储挂载内待扫描媒体的路径,或同时获取媒体中心和外置存储挂载内待扫描媒体的路径,在任务获取单元23获取外置挂载内待扫描媒体的路径之前,还需要判断该外置存储挂载是否存在开关限制,以提醒用户打开具备开关限制的外置存储挂载的开关,方便系统进行扫描和读取,系统获取上述待扫描媒体的路径后,将其添加至媒体扫描服务的任务列表集中,为了进一步提高用户查看所需媒体文件的速度,系统会统计每次在媒体中心或外置存储挂载内完成扫描的媒体文件中,用户最先点击播放的媒体文件的类型,然后依据统计概率对媒体扫描服务的任务列表集内的扫描任务进行优先级的排序,以使得用户最需要首先查看的媒体文件最先被媒体扫描服务扫描释放,显示在媒体中心页面上。
进一步地,参照图7,媒体显示模块30包括:
第二判断单元31,判断是否需要暂停媒体扫描进程,若是,则将所述媒体扫描进程暂停预设时间后,执行所述媒体扫描进程,若否,则继续所述媒体扫描进程;
页面显示更新单元32,添加实时扫描结果至数据库,更新至媒体中心页面进行显示。
在本实施例中,媒体显示模块30包括第二判断单元31和页面显示更新单元32,在任务获取单元23获取到媒体中心和/或外置存储内待扫描媒体的路径,形成媒体扫描任务列表集之后,媒体扫描任务一般就依据所述任务列表集开始对目标媒体文件进行扫描,但是为了进一步保证系统运行的流畅性以及媒体扫描进程的流畅性,在执行媒体扫描之前,会首先由第二判断单元31判断媒体扫描的needStop标志是否需要暂停扫描,也即判断是否需要暂停媒体扫描进程,所述needStop为媒体扫描服务的标志位,该标志位能够决定媒体扫描服务的运行状态,主要由系统发送广播通知更改其状态,在第二判断单元31检测到系统内存已经占用一定比例,媒体扫描服务继续运行时会超过系统内存占用比的预设阈值范围,则第二判断单元31会广播通知needStop更改为暂停状态,暂停所述媒体扫描进程,媒体扫描服务进入暂停状态,在暂停预设时间之后再次判断是否需要暂停扫描,如果是,则继续暂停所述媒体扫描进程,直至不再需要暂停媒体扫描进程,暂停的预设时间一般设置在1秒左右,在其他实施例中,可以根据实际情况另行设定,如果媒体扫描服务继续运行时系统内存占用比仍处于预设的阈值范围内,则广播通知needStop更改为继续扫描状态,继续所述媒体扫描进程,并在执行上述两种扫描逻辑之后,删除相同路径下的原始数据,以释放更多的存储空间,减少系统内存压力,为了使用户更快地查看到所需的媒体文件,页面显示更新单元32会实时添加扫描结果至数据库,以进一步更新至媒体中心页面进行显示,方便用户及时点击查看。
进一步地,参照图8,媒体扫描控制模块50包括:
自定义广播发送单元51,获取对媒体播放器执行的播放、暂停、或停止操作,通过自定义广播发送至媒体扫描服务;
第三判断单元52,判断发送所述自定义广播的媒体播放器的播放状态,
若所述播放状态为暂停或停止,则判断媒体扫描是否完成,若是,则结束媒体扫描进程,若否,则继续所述媒体扫描进程;
若所述播放状态为播放,则判断媒体扫描是否完成,若是,则结束媒体扫描进程,若否,则获取当前媒体播放与媒体扫描占系统内存的比例,判断该比例是否超过预设阈值,若是,则暂停所述媒体扫描进程,若否,则继续媒体播放和媒体扫描进程。
在本实施例中,媒体扫描控制模块50包括自定义广播发送单元51和播放装填判断单元52,在媒体播放器收到执行播放的广播通知后,先对该媒体播放器进行初始化,然后开始执行播放、暂停、或停止事件,自定义广播发送单元51获取对媒体播放器执行的播放、暂停、或停止操作,创建一个自定义广播发送至媒体扫描服务,该自定义广播携带媒体播放器的播放状态播放、暂停、或停止,有时还可能单独创建一个广播控制接收器,来专门接收携带媒体播放器的播放状态的自定义广播,在媒体扫描服务接收到该自定义广播后,由第三判断单元52判断其携带的媒体播放器的播放状态,若所述播放状态为暂停或停止,则判断媒体扫描是否完成,若是,则结束媒体扫描进程,若否,则更改needStop标志为继续扫描状态,继续所述媒体扫描进程,若所述播放状态为播放,则判断媒体扫描是否完成,若是,则结束媒体扫描进程,以减少系统内存的占用,若否,则获取当前媒体播放与媒体扫描占系统内存的比例,判断该比例是否超过预设阈值,若是,则更改needStop标志为暂停扫描状态,暂停所述媒体扫描进程,若否,则继续媒体播放和媒体扫描进程。
本发明还提供一种智能设备,该智能设备包括如上所述的媒体扫描与播放的控制装置100,该智能设备为智能电视、智能手机、PC、智能音箱、或智能投影仪。
在本实施例中,该智能设备可以是智能电视、智能手机、PC、智能音箱、或智能投影仪,上述智能设备均包括上述媒体扫描与播放的控制装置100,该媒体扫描与播放的控制装置100包括媒体扫描启动模块20、媒体显示模块30、媒体播放模块40、及媒体扫描控制模块50,在上述智能设备中打开媒体中心和/或插入外置存储时,媒体扫描启动模块20获取外置存储的接入操作和/或进入媒体中心的操作,广播通知媒体扫描服务执行媒体扫描任务,然后由媒体显示模块30获取媒体扫描服务的扫描进程,实时更新媒体中心页面上的媒体显示,接着在获取到媒体中心页面上有点击播放的操作时,由媒体播放模块40控制媒体播放器对点击选择的媒体文件进行播放,最后由媒体扫描控制模块50获取媒体播放器的播放状态,向媒体扫描服务发送广播通知其继续扫描或暂停扫描,解决了媒体扫描与视频播放抢占内存资源和视频播放卡顿的问题,提高了媒体扫描与媒体播放的流畅性。
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。
Claims (18)
- 一种媒体扫描与播放的控制方法,其特征在于,该控制方法包括以下步骤:获取外置存储的接入操作和/或媒体中心的进入操作,广播通知媒体扫描服务执行扫描任务;获取媒体扫描服务的扫描进程,实时更新媒体中心页面上的媒体显示;获取在媒体中心页面上执行的点击播放操作,控制媒体播放器执行播放;获取媒体播放器的播放状态,广播通知媒体扫描服务继续扫描或暂停扫描。
- 根据权利要求1所述的媒体扫描与播放的控制方法,其特征在于,所述获取外置存储的接入操作和/或媒体中心的进入操作,广播通知媒体扫描服务执行扫描任务的步骤之前,还包括:注册媒体扫描服务和广播通知服务。
- 根据权利要求1所述的媒体扫描与播放的控制方法,其特征在于,所述获取外置存储的接入操作和/或媒体中心的进入操作,广播通知媒体扫描服务执行扫描任务的步骤,具体包括:在打开媒体中心和/或外置存储挂载时,控制广播通知服务向媒体扫描服务发送扫描通知;判断媒体扫描服务是否已经启动,若否,则启动媒体扫描服务;获取媒体中心和/或外置存储内待扫描媒体的路径,添加到媒体扫描服务的任务列表集。
- 根据权利要求2所述的媒体扫描与播放的控制方法,其特征在于,所述获取外置存储的接入操作和/或媒体中心的进入操作,广播通知媒体扫描服务执行扫描任务的步骤,具体包括:在打开媒体中心和/或外置存储挂载时,控制广播通知服务向媒体扫描服务发送扫描通知;判断媒体扫描服务是否已经启动,若否,则启动媒体扫描服务;获取媒体中心和/或外置存储内待扫描媒体的路径,添加到媒体扫描服务的任务列表集。
- 根据权利要求3所述的媒体扫描与播放的控制方法,其特征在于,所述获取媒体扫描服务的扫描进程,实时更新媒体中心页面上的媒体显示的步骤,具体包括:判断是否需要暂停媒体扫描进程,若是,则将所述媒体扫描进程暂停预设时间后,执行所述媒体扫描进程,若否,则继续所述媒体扫描进程;添加实时扫描结果至数据库,更新至媒体中心页面进行显示。
- 根据权利要求要求4所述的媒体扫描与播放的控制方法,其特征在于,所述获取媒体扫描服务的扫描进程,实时更新媒体中心页面上的媒体显示的步骤,具体包括:判断是否需要暂停媒体扫描进程,若是,则将所述媒体扫描进程暂停预设时间后,执行所述媒体扫描进程,若否,则继续所述媒体扫描进程;添加实时扫描结果至数据库,更新至媒体中心页面进行显示。
- 根据权利要求1所述的媒体扫描与播放的控制方法,其特征在于,所述获取媒体播放器的播放状态,广播通知媒体扫描服务继续扫描或暂停扫描的步骤,具体包括:获取对媒体播放器执行的播放、暂停、或停止操作,通过自定义广播发送至媒体扫描服务;判断发送所述自定义广播的媒体播放器的播放状态;若所述播放状态为暂停或停止,则判断媒体扫描是否完成,若是,则结束媒体扫描进程,若否,则继续所述媒体扫描进程;若所述播放状态为播放,则判断媒体扫描是否完成,若是,则结束媒体扫描进程,若否,则获取当前媒体播放与媒体扫描占系统内存的比例,判断该比例是否超过预设阈值,若是,则暂停所述媒体扫描进程,若否,则继续媒体播放和媒体扫描进程。
- 一种媒体扫描与播放的控制装置,其特征在于,该控制装置包括:媒体扫描启动模块,获取外置存储的接入操作和/或媒体中心的进入操作,广播通知媒体扫描服务执行扫描任务;媒体显示模块,获取媒体扫描服务的扫描进程,实时更新媒体中心页面上的媒体显示;媒体播放模块,获取在媒体中心页面上执行的点击播放操作,控制媒体播放器执行播放;媒体扫描控制模块,获取媒体播放器的播放状态,广播通知媒体扫描服务继续扫描或暂停扫描。
- 根据权利要求8所述的媒体扫描与播放的控制装置,其特征在于,该控制装置还包括:注册模块,注册媒体扫描服务和广播通知服务。
- 根据权利要求9所述的媒体扫描与播放的控制装置,其特征在于,所述媒体扫描启动模块包括:扫描通知单元,在打开媒体中心和/或外置存储挂载时,控制广播通知服务向媒体扫描服务发送扫描通知;第一判断单元,判断媒体扫描服务是否已经启动,若否,则启动媒体扫描服务;任务获取单元,获取媒体中心和/或外置存储内待扫描媒体的路径,添加到媒体扫描服务的任务列表集。
- 根据权利要求10所述的媒体扫描与播放的控制装置,其特征在于,所述媒体显示模块包括:第二判断单元,判断是否需要暂停媒体扫描进程,若是,则将所述媒体扫描进程暂停预设时间后,执行所述媒体扫描进程,若否,则继续所述媒体扫描进程;页面显示更新单元,添加实时扫描结果至数据库,更新至媒体中心页面进行显示。
- 根据权利要求8所述的媒体扫描与播放的控制装置,其特征在于,所述媒体扫描控制模块包括:自定义广播发送单元,获取对媒体播放器执行的播放、暂停、或停止操作,通过自定义广播发送至媒体扫描服务;第三判断单元,判断发送所述自定义广播的媒体播放器的播放状态,若所述播放状态为暂停或停止,则判断媒体扫描是否完成,若是,则结束媒体扫描进程,若否,则继续所述媒体扫描进程;若所述播放状态为播放,则判断媒体扫描是否完成,若是,则结束媒体扫描进程,若否,则获取当前媒体播放与媒体扫描占系统内存的比例,判断该比例是否超过预设阈值,若是,则暂停所述媒体扫描进程,若否,则继续媒体播放和媒体扫描进程。
- 一种智能设备,其特征在于,该智能设备包括一媒体扫描与播放的控制装置,所述媒体扫描与播放的控制装置包括:媒体扫描启动模块,获取外置存储的接入操作和/或媒体中心的进入操作,广播通知媒体扫描服务执行扫描任务;媒体显示模块,获取媒体扫描服务的扫描进程,实时更新媒体中心页面上的媒体显示;媒体播放模块,获取在媒体中心页面上执行的点击播放操作,控制媒体播放器执行播放;媒体扫描控制模块,获取媒体播放器的播放状态,广播通知媒体扫描服务继续扫描或暂停扫描。
- 根据权利要求13所述的智能设备,其特征在于,所述控制装置还包括:注册模块,注册媒体扫描服务和广播通知服务。
- 根据权利要求14所述的智能设备,其特征在于,所述媒体扫描启动模块包括:扫描通知单元,在打开媒体中心和/或外置存储挂载时,控制广播通知服务向媒体扫描服务发送扫描通知;第一判断单元,判断媒体扫描服务是否已经启动,若否,则启动媒体扫描服务;任务获取单元,获取媒体中心和/或外置存储内待扫描媒体的路径,添加到媒体扫描服务的任务列表集。
- 根据权利要求15所述的智能设备,其特征在于,所述媒体显示模块包括:第二判断单元,判断是否需要暂停媒体扫描进程,若是,则将所述媒体扫描进程暂停预设时间后,执行所述媒体扫描进程,若否,则继续所述媒体扫描进程;页面显示更新单元,添加实时扫描结果至数据库,更新至媒体中心页面进行显示。
- 根据权利要求13所述的智能设备,其特征在于,所述媒体扫描控制模块包括:自定义广播发送单元,获取对媒体播放器执行的播放、暂停、或停止操作,通过自定义广播发送至媒体扫描服务;第三判断单元,判断发送所述自定义广播的媒体播放器的播放状态,若所述播放状态为暂停或停止,则判断媒体扫描是否完成,若是,则结束媒体扫描进程,若否,则继续所述媒体扫描进程;若所述播放状态为播放,则判断媒体扫描是否完成,若是,则结束媒体扫描进程,若否,则获取当前媒体播放与媒体扫描占系统内存的比例,判断该比例是否超过预设阈值,若是,则暂停所述媒体扫描进程,若否,则继续媒体播放和媒体扫描进程。
- 根据权利要求13所述的智能设备,其特征在于,所述智能设备为智能电视、智能手机、PC、智能音箱、或智能投影仪。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611052489.2A CN106534950A (zh) | 2016-11-22 | 2016-11-22 | 媒体扫描与播放的控制方法、装置 |
CN201611052489.2 | 2016-11-22 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2018094813A1 true WO2018094813A1 (zh) | 2018-05-31 |
Family
ID=58357265
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2016/112863 WO2018094813A1 (zh) | 2016-11-22 | 2016-12-29 | 媒体扫描与播放的控制方法、装置及智能设备 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN106534950A (zh) |
WO (1) | WO2018094813A1 (zh) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107491269B (zh) * | 2017-08-07 | 2021-02-23 | 深圳前海茂佳软件科技有限公司 | 外部存储器文件扫描显示方法、显示终端及存储介质 |
CN110188211B (zh) * | 2019-04-25 | 2023-06-27 | 深圳市布谷鸟科技有限公司 | 一种应用于安卓车载系统快速加载多媒体应用列表的方法 |
CN111881305B (zh) * | 2020-06-23 | 2024-03-01 | 博泰车联网科技(上海)股份有限公司 | 扫描方法及相关设备 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103019839A (zh) * | 2012-11-15 | 2013-04-03 | 广东欧珀移动通信有限公司 | 一种文件快速显示方法、装置及终端 |
CN103747354A (zh) * | 2013-12-03 | 2014-04-23 | 乐视致新电子科技(天津)有限公司 | 智能电视与外接存储设备连接的控制方法和控制装置 |
CN103744912A (zh) * | 2013-12-23 | 2014-04-23 | 乐视致新电子科技(天津)有限公司 | 一种视频文件扫描方法和电子设备 |
CN105487822A (zh) * | 2015-12-03 | 2016-04-13 | 海信集团有限公司 | 一种扫描控制方法和智能设备 |
CN106055611A (zh) * | 2016-05-25 | 2016-10-26 | 努比亚技术有限公司 | 扫描进度显示装置、移动终端及方法 |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104133649A (zh) * | 2014-07-24 | 2014-11-05 | 可牛网络技术(北京)有限公司 | 一种图片显示方法、装置及终端 |
CN106126335A (zh) * | 2016-06-15 | 2016-11-16 | 青岛海信电器股份有限公司 | 终端设备的媒体扫描方法及终端设备 |
-
2016
- 2016-11-22 CN CN201611052489.2A patent/CN106534950A/zh active Pending
- 2016-12-29 WO PCT/CN2016/112863 patent/WO2018094813A1/zh active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103019839A (zh) * | 2012-11-15 | 2013-04-03 | 广东欧珀移动通信有限公司 | 一种文件快速显示方法、装置及终端 |
CN103747354A (zh) * | 2013-12-03 | 2014-04-23 | 乐视致新电子科技(天津)有限公司 | 智能电视与外接存储设备连接的控制方法和控制装置 |
CN103744912A (zh) * | 2013-12-23 | 2014-04-23 | 乐视致新电子科技(天津)有限公司 | 一种视频文件扫描方法和电子设备 |
CN105487822A (zh) * | 2015-12-03 | 2016-04-13 | 海信集团有限公司 | 一种扫描控制方法和智能设备 |
CN106055611A (zh) * | 2016-05-25 | 2016-10-26 | 努比亚技术有限公司 | 扫描进度显示装置、移动终端及方法 |
Also Published As
Publication number | Publication date |
---|---|
CN106534950A (zh) | 2017-03-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2017181506A1 (zh) | 显示终端信源切换方法及装置 | |
WO2019218444A1 (zh) | 测试报告的生成方法、装置、设备及存储介质 | |
WO2015085765A1 (zh) | 推送资讯信息的方法和智能终端 | |
WO2017067293A1 (zh) | 一种指纹解锁的方法、装置和终端 | |
WO2018120681A1 (zh) | 数据同步方法、装置、系统、数据处理服务器和存储介质 | |
WO2019078617A1 (en) | ELECTRONIC APPARATUS AND VOICE RECOGNITION METHOD | |
WO2017084311A1 (zh) | 单分片视频播放加速方法及装置 | |
WO2015026058A1 (en) | Method, terminal, and system for reproducing content | |
WO2018094813A1 (zh) | 媒体扫描与播放的控制方法、装置及智能设备 | |
WO2017036209A1 (zh) | 基于智能电视的音频数据播放方法、智能电视及系统 | |
WO2016065705A1 (zh) | 一种频道列表更新方法、装置及终端设备 | |
WO2019184436A1 (zh) | 视频推送方法、装置及计算机可读存储介质 | |
WO2016129840A1 (en) | Display apparatus and information providing method thereof | |
EP3545684A1 (en) | Electronic apparatus and method of operating the same | |
WO2019125007A1 (en) | Display apparatus and method of operating the same | |
WO2016206223A1 (zh) | 截图的方法及系统 | |
WO2019024472A1 (zh) | 数据操作方法、装置及计算机可读存储介质 | |
WO2019088627A1 (en) | Electronic apparatus and controlling method thereof | |
WO2019168265A1 (ko) | 전자 장치, 전자 장치의 태스크 처리 방법 및 컴퓨터 판독 가능 매체 | |
WO2016058471A1 (zh) | 显示设备及对mhl信源实现来电通功能的方法 | |
WO2023027487A1 (ko) | 디스플레이 장치 및 디스플레이 장치의 제어 방법 | |
WO2016127663A1 (zh) | Epg刷新方法及系统 | |
WO2019103480A1 (en) | Broadcast receiving apparatus and control method thereof | |
WO2016036227A1 (ko) | 셋탑 박스, 그를 이용한 IoT 기기 제어 방법 및 컴퓨터 프로그램 | |
WO2011090288A2 (en) | Electronic device and operating method of the same |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16922107 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 04.10.2019) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 16922107 Country of ref document: EP Kind code of ref document: A1 |