The terms "comprising" and "having," and any variations thereof, in the description and claims of this invention and the drawings described herein are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
In order to solve the conflict between the live television recording and the media playing on the hardware resource, when the live television recording is started, the existing common method is to query the state of the media player in an inter-process communication mode, that is, the live television recording module and the media player are in different processes, the state of the media player needs to be queried in a message sending mode, the state of the media player is not recorded in the media player, the media player needs to be queried at a bottom layer, and then the state is fed back to the live television recording module through a message, if the state of the media player is a playing state, the media playing is stopped, and then the recording is started. The problems caused by the above procedure are: if the state of the media player is not the playing state, the inquiring process still exists, and the inquiring time is long, so that the system overhead is increased, and the black screen time before the live television is started for recording is long. If the state of the media player is a playing state, the live television recording needs to be started after the media player really stops playing and resources are released, and the common method is that if the state of the media player is a playing state, the live television recording is started after a waiting time (experience value) elapses. And if the media player releases the resources and times out, the live television recording is failed to start.
Based on the above problems, the present invention provides a method for recording a live television, which can report the state of a media playing module after the state of the media playing module changes, and the live television recording module can start the live television recording according to the non-playing state of the media playing module, so that the black screen time before the live television recording is started is short, and the user experience is improved.
The terminal device related in the embodiment of the invention includes a television and other terminal devices.
The technical solution of the present invention will be described in detail below with specific examples. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
Fig. 1 is a schematic flow chart of a live television recording method according to a first embodiment of the present invention. As shown in fig. 1, the method of this embodiment may be applied to a terminal device, where the terminal device includes a monitoring module, a live tv recording module, and a media playing module, and the method may include:
step 101, a monitoring module receives a state reported by a media playing module; the state is reported by the media playing module after the state of the media playing module changes.
In this step, the media playing module reports the state after the state of the media playing module changes, for example, the state changes from the non-playing state to the playing state or from the playing state to the non-playing state, which can reduce the system overhead and power consumption, and the monitoring module receives the state reported by the media playing module.
And 102, reading the state of a media playing module in the monitoring module by the live television recording module before starting live television recording.
And 103, if the state of the media playing module is the non-playing state, starting live television recording by the live television recording module.
Specifically, the live television recording module reads the state of the media playing module recorded in the monitoring module before starting recording, wherein the state is reported by the media playing module, so as to determine whether to start live television recording, and if the state of the media playing module is an unplayed state, the live television recording module starts live television recording.
Step 104, if the state of the media playing module is the playing state, the monitoring module generates a playing stopping command and sends the command to the media playing module; the stop playing command is used for instructing the media playing module to stop playing the media content.
In this step, if the state of the media playing module is the playing state, the monitoring module generates a playing stop command and sends the command to the media playing module.
After receiving the playing stop command, the media playing module stops playing the media content according to the instruction of the playing stop command, and reports the state of the media playing module after releasing the resource, that is, reports the state of the media playing module when the playing state is changed into the non-playing state.
The live television recording module can start the live television recording when reading the unplayed state in the monitoring module, and the live television recording can be started successfully.
It should be noted that, in the embodiment of the present invention, step 103 and step 104 are not in sequence.
In practical application, before step 101, the following steps may be further included:
the media playing module sends a registration request to the monitoring module when the process is started;
the monitoring module receives a registration request sent by the media playing module;
and the monitoring module performs registration operation on the media playing module according to the registration request.
In practical application, after step 101, the following steps may be further included:
when the process is closed, the media playing module sends a registration removing request to the monitoring module;
the monitoring module receives a de-registration request sent by the media playing module;
and the monitoring module carries out deregistration operation on the media playing module according to the deregistration request.
Specifically, the media playing module registers with the monitoring module when the used process is started, and the media playing module registers with the monitoring module when the used process is closed.
In an implementation manner of the embodiment of the present invention, the registration and deregistration operations may be specifically implemented by sending a registration request and a deregistration request.
In practical application, the monitoring module and the live television recording module run in one process.
When the live television recording module reads the state of the media player, the monitoring module and the live television recording module are positioned in the same process, so that the process occupies shorter time.
The media playing module needs to actively report the state to the monitoring module in the using process. When the media playing module is in use, that is, when playing media content, it needs to inform the monitoring module that the current media playing module is in a playing state, and when the media playing module stops playing the media content, it also needs to inform the monitoring module that the current state is in an unplayed state. Therefore, when the live television recording module starts the live television recording, whether media content is played currently or not is known according to the state of the media playing module recorded in the monitoring module, and if not, the recording is started immediately, so that the system calling and black screen waiting time is reduced.
And through registering and deregistering the mechanism, the monitoring module can monitor the media playing module after it registers, the media playing module reports the state of the media playing module initiatively, if after deregistering, can not go to monitor the state of the media playing module, have avoided the unnecessary power consumption, and if the state of the media playing module is the state of not broadcasting, can start the live telecast to record directly, can guarantee that the live telecast records and starts the success, and can reduce the system call, thus save the system overhead, shorten the black screen time before the live telecast records and starts.
In the method for recording a live television provided by this embodiment, a monitoring module receives a state reported by a media playing module; the state is reported by the media playing module after the state of the media playing module changes; the live television recording module reads the state of a media playing module in the monitoring module before starting the live television recording; if the state of the media playing module is a pre-reported state, the process of reading the state is short, and the black screen time before the television recording is started is shortened, the user experience is improved, and the power consumption is low because the reported state is the state after the state of the media playing module is changed.
On the basis of the foregoing embodiment, further, after step 104 in this embodiment, the following step may be further included:
the media playing module receives a playing stopping command;
the media playing module stops playing the media content according to the playing stopping command and reports the state of the media playing module after releasing the resources.
Further, the method can also comprise the following steps:
after receiving the state reported by the media playing module, the monitoring module sends a notification message to the live television recording module; the notification message is used for indicating the live television recording module to start the live television recording;
and after receiving the notification message, the live television recording module starts live television recording.
Specifically, when starting recording, the live television recording module may determine whether to start live television recording according to a state reported by the media playing module recorded in the monitoring module, and if the state of the media playing module is a playing state, the monitoring module generates a play stop command and sends the command to the media playing module.
After receiving the playing stop command, the media playing module stops playing the media content according to the instruction of the playing stop command, and reports the state of the media playing module after releasing the resource, that is, reports the state of the media playing module when the playing state is changed into the non-playing state.
When the monitoring module receives the reported unplayed state, a notification message is sent to the live television recording module to indicate the live television recording module to start live television recording, and the live television recording module starts live television recording after receiving the notification message, so that the situation that the live television recording module is started after waiting for the preset time and is likely to be failed to start when the media playing module is in the playing state in the existing scheme can be avoided, and the live television recording can be started successfully.
In this embodiment, if the state of the media playing module is the playing state, the monitoring module generates a playing stop command and sends the command to the media playing module; the media playing module stops playing media contents according to the playing stopping command, reports the state of the media playing module after resources are released, and the monitoring module sends a notification message to the live television recording module after receiving the state reported by the media playing module, so as to instruct the live television recording module to start the live television recording.
Fig. 2 is a structural diagram of an embodiment of a terminal device provided in the present invention, and as shown in fig. 2, the terminal device of this embodiment may include:
a monitoring module 201, a live television recording module 202 and a media playing module 203;
the monitoring module 201 is configured to receive a status reported by the media playing module 203; the state is reported by the media playing module 203 after the state of the media playing module 203 changes;
a live television recording module 202, configured to read a state of the media playing module 203 in the monitoring module 201 before a live television recording is started;
if the state of the media playing module 202 is an unplayed state, live television recording is started.
If the state of the media playing module 202 is a playing state, the monitoring module 201 is further configured to generate a playing stop command and send the playing stop command to the media playing module 202; the stop playing command is used for instructing the media playing module to stop playing the media content.
Optionally, as an implementable manner, the media playing module 202 is configured to receive the stop playing command;
the media playing module 202 is further configured to stop playing the media content according to the playing stop command, and report the state of the media playing module 202 after releasing the resource.
Optionally, as an implementable manner, the monitoring module 201 is further configured to send a notification message to the live tv recording module 202 after receiving the state reported by the media playing module 203; the notification message is used for indicating the live television recording module to start live television recording;
the live television recording module 202 is further configured to start live television recording after receiving the notification message.
Optionally, as an implementable manner, the monitoring module 201 and the live tv recording module 202 run in one process.
Optionally, as an implementable manner, the media playing module 202 is further configured to send a registration request to the live tv recording module 201 when a process is started;
the live television recording module 201 is further configured to receive the registration request sent by the media playing module 202;
the live television recording module 201 is further configured to perform a registration operation on the media playing module 202 according to the registration request.
Optionally, as an implementable manner, the media playing module 202 is further configured to send a registration removal request to the live tv recording module 201 when the process is closed;
the live television recording module 201 is further configured to receive the deregistration request sent by the media playing module 202;
the live television recording module 201 is further configured to perform a deregistration operation on the media playing module 202 according to the deregistration request.
The apparatus of this embodiment may be configured to implement the technical solutions of the above method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
Fig. 3 is a structural diagram of another embodiment of a terminal device provided by the present invention, and as shown in fig. 3, the terminal device includes:
a processor 301, and a memory 302 for storing executable instructions of the processor 301.
The processor is configured to support the terminal device to execute the method corresponding to the foregoing method embodiment, and for a specific implementation process, reference may be made to the foregoing method embodiment, which achieves similar principles and technical effects, and details are not described here.
Optionally, the terminal device of this embodiment may further include a multimedia component, and the multimedia component includes a screen providing an output interface between the terminal device and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP).
Optionally, the terminal device of this embodiment may further include an audio component configured to output and/or input an audio signal. For example, the audio assembly includes a speaker for outputting audio signals.
Optionally, the terminal device of this embodiment may further include a communication component, where the communication component is configured to facilitate wired or wireless communication between the terminal device and other devices.
The embodiment of the invention also provides a non-transitory computer readable storage medium, and when an instruction in the storage medium is executed by a processor of the terminal device, the terminal device can execute the live television recording method of the terminal device.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the units or modules is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or modules may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.